Hey,
using SAS 9.2
Having an issue using SFTP from my Unix SAS server to a Linux server. I have already setup my rsa key and have added it to knownhost file. I am able to ssh without a password so that shouldn't be the issue. However When ever i try to SFTP though SAS with the following code i get the following error:
FILENAME COOL SFTP "/home/myhome/cool.txt" USER='user' HOST="myhost" DEBUG;
DATA COOLSAS;
INFILE COOL DLM='|' DSD;
INPUT TEST $;
RUN;
PROC PRINT DATA=COOLSAS (OBS=100); RUN;
NOTE: Connected to <host>.
NOTE: sftp> cd /home/myhome/
NOTE: sftp> get cool.txt /data/SASWORK/SAS_workD88300960066_p00012/#LN00058Fetching
/home/myhome/cool.txt to /data/SASWORK/SAS_workD88300960066_p00012/cool.txt
ERROR: Physical file does not exist, /data/SASWORK/SAS_workD88300960066_p00012/#LN00058.
NOTE: The SAS System stopped processing this step because of errors.
The file on the remote server certainly exist, i have triple checked it. in fact it looks like in the work library the file is actually transferred over. However SAS never reads the file in and then for some reason is looking for this file and errors out when it cant find it
ERROR: Physical file does not exist, /data/SASWORK/SAS_workD88300960066_p00012/#LN00058.
Thanks
The message is clear, and it's not coming from SAS, but from sftp:
"/home/myhome/cool.txt" not found.
The file is not there.
File is certainly there. In fact the file is actually transferred over to SAS to the temp Work library. However then SAS throws in This error.
ERROR: Physical file does not exist, data/SASWORK/SAS_workD88300960066_p00012/#LN00058.
It never reads the file in after that point.
Is that path to your WORK library in the SAS error correct - does it match the definition of your WORK library in your SAS session?
yup sure does. And the file does transfer over to the correct work location...so sas is getting that part right. But this #LN00058 file doesnt exist. Not even sure what its doing with that file.
I suggest you track this problem to SAS Tech Support if you haven't already done so.
I pointed out the message from SFTP to you. Ignoring it will not make the cause go away. The file is not where the sftp expects it on the remote server, period.
Unless you failed to post the log correctly.
log was posted incorrectly and corrected above. The file exist, the corrected question above now reflects that....thanks
NOTE: sftp> get cool.txt /data/SASWORK/SAS_workD88300960066_p00012/#LN00058Fetching /home/myhome/cool.txt to /data/SASWORK/SAS_workD88300960066_p00012/cool.txt
The crucial part is this:
Fetching
/home/myhome/cool.txt to /data/SASWORK/SAS_workD88300960066_p00012/cool.txt
(emphasis by me)
Somehow the sftp does not honor the target name and uses the source file name for the target.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.