Date: Wed, 5 Mar 2008 16:26:46 -0500
Reply-To: roger.s.clark@CENSUS.GOV
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "NOMAIL Roger S. Clark" <roger.s.clark@CENSUS.GOV>
Subject: Re: macro?
Content-type: text/plain; charset=US-ASCII
> Hi All,
> Anyone give any suggestions on how to do the following: (I get an
> error on the %macro line)
>
> %let x = testermac;
> %put &x;
>
> %macro &x;
> %mend ;
>
> %testermac;
It has been years since I took any training in SAS macros. However, I seem
to remember something about the macro being compiled first, before the rest
of the program is compiled. (I might be hazy on that...) Consequently,
your macro is being defined before the variable &x is resolved in the macro
name. SAS isn't seeing %macro testermac, but a literal %macro &x.
Thanx,
Roger S. Clark
Address Products Management Branch
763-9177 4H584U
|