Date: Mon, 18 Sep 2006 11:51:34 -0400
Reply-To: Jack Clark <JClark@CHPDM.UMBC.EDU>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jack Clark <JClark@CHPDM.UMBC.EDU>
Subject: Re: Nesting Macro Variables
Content-Type: text/plain
Reeza,
Two things I see right away...
1. The prepdata macro contains a data step, which you are calling in the
middle of a data step in the start macro. That is not valid programming
code.
2. You would have to move your call of the start macro below the code for
the prepdata macro since the prepdata macro would have to be compiled prior
to being called.
Jack Clark
Research Analyst
Center for Health Program Development and Management
University of Maryland, Baltimore County
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Reeza
Sent: Monday, September 18, 2006 11:37 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Nesting Macro Variables
Hi All,
I'm trying to run some code using Macro's, but some of the nested
variables aren't resolving. I probably have some mistake in coding, so
any help is appreciated.
Thanks,
Reeza
%macro start();
%do i=1971 %to 1975;
data _null_;
call symput ('yr', i);
%put &yr;
%prepdata(&yr.);
run;
%end;
%mend start;
%start();
%macro prepdata(test);
data master;
merge sim.fixedpar sim.actualSM (where=(year=&test));
by RA;
if RA in (15 81 110) then delete;
rename RA=Risk_Area_ID;
run;
***Other Code follows;
%mend;