LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 1998, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 2 Nov 1998 16:54:24 -0600
Reply-To:   Scuttlebutt <jbailey@CYBERCONNECT.COM>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   Scuttlebutt <jbailey@CYBERCONNECT.COM>
Organization:   http://extra.newsguy.com
Subject:   Macro parameter passing question

/* 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;


Back to: Top of message | Previous page | Main SAS-L page