If an EXECUTE routine
argument is a macro invocation or resolves to one, the macro executes
immediately. Execution of SAS statements generated by the execution
of the macro will be delayed until after a step boundary. SAS macro
statements, including macro variable references, will execute immediately.
Note: Because of the delay of the
execution of the SAS statements until after a step boundary, references
in SAS macro statements to macro variables created or updated by the
SAS statements will not resolve properly.
Note: Because macro references
execute immediately and SAS statements do not execute until after
a step boundary, you cannot use CALL EXECUTE to invoke a macro that
contains references for macro variables that are created by CALL SYMPUT
in that macro. For a workaround, see the following TIP.
Tip
The following example uses
the %NRSTR macro quoting function to mask the macro statement. This
function will delay the execution of macro statements until after
a step boundary.
call execute('%nrstr(%sales('||month||'))');