| Date: | Mon, 18 Sep 2006 08:51:24 -0700 |
| Reply-To: | monal kohli <k_monal_99@YAHOO.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | monal kohli <k_monal_99@YAHOO.COM> |
| Subject: | Re: Nesting Macro Variables |
|
| In-Reply-To: | <1158593832.262766.327160@e3g2000cwe.googlegroups.com> |
| Content-Type: | text/plain; charset=iso-8859-1 |
The basic problem with this code is that you are
trying to reference the macro variable yr in the same
datastep in which you are creating it through call
symput.
HTH
Mona
--- Reeza <fkhurshed@HOTMAIL.COM> wrote:
> 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;
>
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|