Date: Wed, 14 Jun 2000 19:27:29 -0400
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Richard W. Graham" <Richard.Graham@INTELLICISIONS.COM>
Subject: Re: macro variables
The most straigtforward way I know of to process would be the following:
sum = sum(of %do i = 1 %to 200; &&var&i %end;);
But to make it more dynamic you could keep a counter of the number of macro
variables within another macro variable (i.e., numvars), then change the
200 above to &numvars.
Richard W. Graham
Senior Consultant, Technology Delivery
Intellicisions Data Inc.
2000 Regency Parkway, Suite 355
Cary, NC 27511
(Embedded image moved to file: pic24121.gif)
<chang5a@YAHOO To: SAS-L@LISTSERV.UGA.EDU
.COM> cc: (bcc: Richard Graham/Tech/Intellicisions)
Sent by: Subject: macro variables
to Annie Chang
I have a question about use of variables. I created
200 macro variables, say, called 'var1, var2, ...,
var200'. Now I need to do a calculatin on it. For
sum = &var1 + &var2 + ... + &var200;
Obviously, I couldn't use the '...'. Well, I know I
can type those 200 variables but I bet there got to be
a better way and you know it!
P.S. BTW, a couple of weeks ago, I asked another
question and got quite a few answers. Most of them
work fine and solved my problem. Thank you all! This
is a great place and I couldn't resist to think about
this list when I got a problem (I'll try very hard
first to avoid asking you too trivial ones.)
Do You Yahoo!?
Yahoo! Photos -- now, 100 FREE prints!