Am getting the error "ERROR: Physical file does not exist, /testclear.zip".
Code is:-
filename rmt ftp '/testclear.zip' host='sftp.ucas.com'
user='anonymous' pass='XXXXX'
cd='/incoming/' recfm=s debug;
FILENAME lcl '\\par2\adi\data\STROBE\Jobs\2017\SR170601_001_BRITCO\PROJECT\RAW_DATA\testclear.zip' recfm=n;
data _NULL_;
N=1;
INFILE rmt NBYTE=n;
INPUT;
FILE lcl ;
PUT _INFILE_ @@;
run;
The rest of the log looks ok and file does exist and can be retrieved using FTP portal. Can anyone help?
Remove the leading forward slash from the filename:
filename rmt ftp 'testclear.zip' host='sftp.ucas.com'
user='anonymous' pass='XXXXX'
cd='/incoming/' recfm=s debug;
Remove the leading forward slash from the filename:
filename rmt ftp 'testclear.zip' host='sftp.ucas.com'
user='anonymous' pass='XXXXX'
cd='/incoming/' recfm=s debug;
Ok I've tried that and it still doesn't work.
filename rmt ftp '' host='sftp.ucas.com'
user='anonymous' pass='XXXXX'
cd='/incoming/' recfm=s debug;
FILENAME lcl '' recfm=n;
data _NULL_;
N=1;
INFILE rmt NBYTE=n;
INPUT;
FILE lcl ;
PUT _INFILE_ @@;
run;
The source file is simply not there. I just did this:
$ ftp sftp.ucas.com Connected to sftp.ucas.com. 220 UKPASS Secure FTP Server Name (sftp.ucas.com:XXXXX): anonymous 331 Password required for anonymous. Password: 230 Login OK. Proceed. ftp> cd /incoming/ 250 Folder changed to "/incoming". ftp> ls 200 Command okay. 150 Opening ASCII mode data connection for file list. jb.txt 226 Transfer complete. 8 bytes transferred. 8 Bps. ftp> quit
As you can see, there's only one file named jb.txt there.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.