Date: Tue, 21 Oct 2008 12:13:26 -0400
Reply-To: Scott Raynaud <scott.raynaud@TARGETBASE.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Scott Raynaud <scott.raynaud@TARGETBASE.COM>
Subject: variable creation
I need to set up code that will create variables and initialize them to
zero. Say I have a %let yof=2008 at the top of my command file. I need
to set up a loop that will create and initialize a sales variable
beginning at 2001 and ending with yof-1 inside a data step that looks
something like this pseudo code:
data aaa
set bbb;
do i=1 to yof-1;
sales_i=0;
end;
run;
Ideally, this would yield sales_01 to sales_07 in this example, all set to
zero.
I guess I need to convert this pseudo code to macro code but I'm not
exactly sure how to do so. Any help appreciated.
|