Date: Wed, 24 Oct 2001 09:39:56 -0600
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: jimcmi2 <jimcmi2@QWEST.COM>
Subject: Format for FTP File Name
Content-Type: text/plain; charset="iso-8859-1"
I am writing SAS code that will execute at the beginning of each day. The
program will pull data from an FTP site and load it into a SAS dataset. I
have written the code below, the problem remains in formatting the file name
and directory for the FTP. The file name consists of a test name that has
the month and day in it the directory has the day in the directory name.
The file name and directory has to change based on the current day and
For example given today is 10/25 the FTP file name is
"Daily1025DataDump.txt" and the directory for the location of the file is
I have created the code below, however I do not know how to pass the file
name and directory to the FTP statement.
I am sure this could be done with a simple macro, but I have not grasped the
macro concepts yet.
Thanks for your assistance.
data credit.recent_data_dump_ftp ;
Format Day $2. ;
Format Month $2. ;
NameofFile = 'Daily'||Month||Day||'QWestDataDump.txt';
DirofFile = '/Rpt_'||Month ;
filename dump_01 ftp ? cd=?
user='rm1019' pass='cor4ty8' host='22.214.171.124'
infile dump_01 dsd dlm= '|' LRECL=956 ;
format (Long format statement not copied into this email) ;
input (long input statement not copied into this email)