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.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.