Date: Tue, 14 Jun 2005 17:30:01 -0400
Reply-To: Peter Crawford <peter.crawford@BLUEYONDER.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Peter Crawford <peter.crawford@BLUEYONDER.CO.UK>
Subject: Re: output file by ftp from sas
On Tue, 14 Jun 2005 14:03:33 -0700, paulsparrow <paulsparrow@TELUS.NET>
>I am trying to ftp a file out using SAS. Having an issue with the code
>not being able to find the file. Yes the file is correctly spelled and
>located as in code. Any answers?
>232 filename transfer ftp
Can your ftp server see this c:\ drive and path ?
>234 user = 'itw' /*prompt*/
>235 pass = XXXXXXX
>236 host = 'ftp.site.com'
>237 cd = 'Data_Files'
why send the ftp server focus to this directory,
when your file is given with a drive and path?
>240 data _null_ ;
>241 file transfer ;
>242 put ;
this put statement seems very odd.
There is nothing to "put"
>243 run ;
>NOTE: 220 eldiablo Microsoft FTP Service (Version 4.0).
>NOTE: <<< 220 eldiablo Microsoft FTP Service (Version 4.0).
>NOTE: >>> USER itw
>NOTE: <<< 331 Password required for itw.
>NOTE: >>> PASS XXXXX
>NOTE: <<< 230 User itw logged in.
>NOTE: >>> PORT 10,0,15,232,8,85
>NOTE: <<< 200 PORT command successful.
>NOTE: >>> TYPE A
>NOTE: <<< 200 Type set to A.
>NOTE: >>> CWD Data_Files
>NOTE: <<< 250 CWD command successful.
>NOTE: >>> PWD
>NOTE: <<< 257 "/itw/Data_Files" is current directory.
>NOTE: >>> STOR c:\testftp.txt
>NOTE: <<< 550 c:\testftp.txt: The filename, directory name, or volume
>label syntax is incorrect.
>ERROR: Physical file does not exist, c:\testftp.txt.
>NOTE: The SAS System stopped processing this step because of errors.
>NOTE: DATA statement used:
> real time 2.31 seconds
> cpu time 0.01 seconds
I suspect you just want the dos client ftp syntax to transfer a file.
If you want to write the c:\testftp.txt file into
your data_files folder on the ftp server, you might
use sas like (untested example)
filename transfer ftp
user = 'itw' /*prompt*/
pass = XXXXXXX
host = 'ftp.site.com'
cd = 'Data_Files'
infile "c:\testftp.txt" lrecl= 30000 ;
file transfer lrecl= 30000 ;
put _infile_ ;
But dos ftp seems a whole lot cheaper than a sas service ;-)