Date: Thu, 9 Nov 2006 08:09:30 -0800
Reply-To: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Terjeson, Mark" <Mterjeson@RUSSELL.COM>
Subject: Re: Setting up
Content-Type: text/plain; charset="us-ascii"
Hi Ben,
FILEVAR can be handy if you are using
INFILE to read external files. For the
SET statement, to create repetitious
code, a macro can be good for that.
The SAS Macro facility can create the
text string with the names and substitute
it into your code (as if you wrote it)
just before your code gets to the compiler.
%macro multfiles(lo,hi);
%let files=;
%do i = &lo %to &hi;
%let files=&files _&i;
%end;
&files
%mend;
%put files is >%multfiles(1,31)<;
Data need ;
set %multfiles(1,31) ;
Run ;
Hope this is helpful.
Mark Terjeson
Senior Programmer Analyst, IM&R
Russell Investment Group
Russell
Global Leaders in Multi-Manager Investing
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
BenDray
Sent: Thursday, November 09, 2006 1:37 AM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Setting up
Hi all,
Can you tell me how best to go about doing this - I am trying to set a
bunch of datasets (_1 -> _31) :
Data need ;
do i=1 to 31 ;
set _||i ;
end ;
Run ;
Many thanks!
Ben
|