LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (February 2000, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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?
Comments: To: oliver <oliver@AGYINC.COM>
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


Back to: Top of message | Previous page | Main SAS-L page