|
/* How can I pass the value of "&mac" back to the calling program
as a global macro variable to be used as a parameter for the next call
to MACRO SUB?
I also need to be able to update the variable with statements like this:
&mac= &mac + x;
like a typical Pascal or FORTRAN program. Here the macro is resolved
before the code execution, and leads to an error. I need some kind of
global
counter variable that can be used in macro subroutines. Does this make
sense? Thanks in advance!!
*/
%macro SUB(mac);
data junk;
statement that changes the value of &mac;
more stuff;
run;
%mend;
%macro big;
data _null_;
%sub(1);
.
.
%sub(&mac); /* runs SUB using updated value of &mac */
run;
%mend;
%big;
|