Type: | Macro statement |
Restriction: | Allowed in macro definitions or open code |
See: | %MEND Statement and SYSPBUFF Automatic Macro Variable |
positional-parameter-1 <. . . ,positional-parameter-n> | specifies one or more positional parameters. You can specify positional parameters in any order, but in the macro invocation, the order in which you specify the values must match the order that you list them in the %MACRO statement. If you define more than one positional parameter, use a comma to separate the parameters. If at invocation that you do not supply a value for a positional parameter, the macro facility assigns a null value to that parameter. |
keyword-parameter=<value> <. . . ,keyword-parameter-n=<value>> | names one or more macro parameters followed by equal signs. You can specify default values after the equal signs. If you omit a default value after an equal sign, the keyword parameter has a null value. Using default values enables you to write more flexible macro definitions and reduces the number of parameters that must be specified to invoke the macro. To override the default value, specify the macro variable name followed by an equal sign and the new value in the macro invocation. |
IN
and the special character #
as logical operators when evaluating arithmetic or logical expressions
during the execution of the macro. The setting of this argument overrides
the setting of the NOMINOPERATOR global system option.
IN
and the special character #
as logical operators when evaluating arithmetic or logical expressions
during the execution of the macro. The setting of this argument overrides
the setting of the MINOPERATOR global system option.
%macro finance(yvar=expenses,xvar=division); proc plot data=yearend; plot &yvar*&xvar; run; %mend finance;
%macro printz/parmbuff; %let num=1; %let dsname=%scan(&syspbuff,&num); %do %while(&dsname ne); proc print data=&dsname; run; %let num=%eval(&num+1); %let dsname=%scan(&syspbuff,&num); %end; %mend printz;
options mstored sasmstore=mylib; libname mylib "mylib"; %macro nonsecure/store; /* This macro is stored in plain text */ data _null_; x=1; put "This data step was generated from a non-secure macro."; run; %mend nonsecure; %nonsecure filename maccat catalog 'mylib.sasmacr.nonsecure.macro'; data _null_; infile maccat; input; list; run;
options mstored sasmstore=mylib; libname mylib "mylib"; %macro secure/store secure; /* This macro is encrypted */ data _null_; x=1; put "This data step was generated from a secure macro."; run; %mend secure; %secure filename maccat catalog 'mylib.sasmacr.secure.macro'; data _null_; infile maccat; input; list; run;