BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
kimdukes77
Obsidian | Level 7

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?

1 ACCEPTED SOLUTION

Accepted Solutions
3 REPLIES 3
Kurt_Bremser
Super User

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;
kimdukes77
Obsidian | Level 7

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;

 

 

Kurt_Bremser
Super User

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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2184 views
  • 0 likes
  • 2 in conversation