Date: Wed, 16 Feb 2000 19:10:13 "GMT"
Reply-To: "David L. Ward" <dward@SASHELP.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "David L. Ward" <dward@SASHELP.COM>
Subject: Re: Can I include datafile name in the SAS command line?
Content-Type: text/plain; charset="us-ascii"
To answer the question exactly as asked, use the sysparm option when SAS is invocated i.e.
SAS command.sas -sysparm 'nameofdatafile.data'
Then replace your infile statements with
infile "&sysparm"; (double quotes are important to make the macro variable resolve)
It sounds like learning some SAS macro programming would help you quite a bit. Using fairly simple macro code you could have SAS read in a list of file names and run your code for each filename, all within the same program.
HTH
David Ward
SASHelp.com
-----Original Message-----
From: oliver <oliver@AGYINC.COM>
Sent: 2/16/00 6:52:47 PM
Subject: Can I include datafile name in the SAS command line?
> Hi, SAS experts
>
>I have to run SAS against so many different data file. I used to replace
>the infile inside .sas file each time. This time i face almost hundred
>different data file. Is it possible that I can give the datafile name
>out of the sas file and run in the command line like
>>SAS command.sas nameofdatafile.data
..
>To make it clear, my code like:
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
>DATA data1;
>infile '/mnt/r1/BV2TC2/05044E263.csv'
> DLM = ','
> LRECL=1000 /*logical record length set longer than 256 by
>default*/
> FIRSTOBS = 17
> OBS =80
> ;
_____________________________________________________
Sent by SASHelp.com user DWard
SASHelp.com - On-Line SAS Resources
Web interface to SAS-L at http://www.sashelp.com/sasl