Date: Fri, 3 Jan 2003 15:52:57 -0000
Reply-To: Roland <roland@RASHLEIGH-BERRY.FSNET.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Roland <roland@RASHLEIGH-BERRY.FSNET.CO.UK>
Subject: Re: Help with creating global macro variables
You can not use a cards statement within a macro, afaik. Also, it is a sas
statement and not a sas macro statement so you certainly can not use it in
sas macro code.
So long as you have the value of numcards set up in a macro variable then do
it like this:
136 %let numcards=10;
137
138 %macro test;
139 %do y=1 %to &numcards;
140 %global Spl&y;
141 %end;
142 %mend test;
143
144 %test;
145
146 %put >>> S1p5=&S1p5;
>>> S1p5=
"Shukla Kshirsagar" <shuklak@HOTMAIL.COM> wrote in message
news:200301031524.h03FO8J01223@listserv.cc.uga.edu...
> Hello everybody,
>
> I need some help with creating some global macro variables. I am using
the
> following code, and I get attached error
>
> Code:
> %macro test;
> %global
> %do y=1 %to &numcards;
> &&Slp&y;
> %end;
> ;;;
> %mend test;
> %test;
>
> Error:
>
> Macro keyword DO appears as text. A semicolon or other delimiter may be
> missing.
> 5699 &&Slp&y;
> 5700 %end;
> ERROR: There is no matching %DO statement for the %END. This statement
will
> be ignored.
>
> Any suggestions? Thanks for your help on this and all other questions I
> haved posed to the group.
>
> Shukla
|