Hi
The syntax to define a macro looks as follows:
%macro MacroFunctionName;
...
Code
...
%mend MacroFunctionName;
where MacroFunctionName is the name of the macro definition(which is probably
pretty obvious but just to be clear :-) )
below a (more or less)full sas code snippet of a macro function.
/*-----------------------------------*/
/* Check if there was data found */
/*-----------------------------------*/
%macro check_if_edc_found;
%let timenow=%sysfunc(time(), time.);
%put ----- [&timenow] MACRO: check_if_edc_found -----;
%global nr;
data _null_;
set SAVE.EDCdata_all end=end;
if end then call symputx('nr',_N_);
run;
%put SAVE.EDCdata_all: nr of observations=&nr;
%if "&nr"="" %then %do;
data _null_;
file _webout;
/* Set title of webpage */
put "<title>No data found</title>";
[...]
put "</body></html>";
run;
%let abort=1;
%abort;
%end;
%mend;
:-)):-)):-)):-))
--
<https://forum.pspad.com/read.php?2,70389,70897>
PSPad freeware editor https://www.pspad.com