07-07-2017 04:06 AM
I'm unable to import a file from Remote server using SFTP. I tried the following code, but the code has failed with the error. I verified SFTP connection from our SAS Grid server and credentials looks fine. I am able to import the file using SFTP client which means I confirm that file exists in the directory.
data aaaa; a=1; run; FILENAME in SFTP '/IN/SNAP/CAT_20170705171730.txt' LRECL=256 HOST='sftp://babloo_SFTP@b2b.cabdo.com' USER='babloo_SFTP' ; DATA _NULL_; INFILE in; INPUT HOUSEHOLD_ID; RUN; PROC PRINT DATA=_NULL_(obs=10); RUN;
Snippet from Log:
34 DATA _NULL_; 35 INFILE in; 36 INPUT HOUSEHOLD_ID; 37 RUN; 2 The SAS System 08:49 Wednesday, July 5, 2017 NOTE: cd /IN/SNAP ERROR: Directory or file /IN/SNAP/CAT_20170705171730.txt doesn't exist. NOTE: The SAS System stopped processing this step because of errors
07-07-2017 04:33 AM
Log on to the server with sftp (you do have public/private key authentication enabled?), change to the directory, do a ls there, and then post a copy/paste of the whole process here.
07-07-2017 05:27 AM
sftp> cd /IN/SNAP
Remote working directory: /IN/SNAP
07-07-2017 05:49 AM
Reduce the host= in your code to the bare hostname:
FILENAME in SFTP '/IN/SNAP/CAT_20170705171730.txt' LRECL=256 HOST='b2b.cabdo.com' USER='babloo_SFTP' ;
No protocol and/or username necessary and allowed there.
07-07-2017 05:54 AM
07-07-2017 06:56 AM
Well, I tried something similar (filename sftp from a Linux server), and when I added the "sftp://username@" to the host name, I got exactly your error message.
Please post the log of the complete step, from filename statement to the ERROR message.
07-07-2017 07:49 AM
28 FILENAME in SFTP '/Babloo_SFTP/IN/SNAP/CAT_20170705171730.txt' 29 HOST="Babloo_SFTP@b2b.cabdo.com" 30 USER='Bablopp_SFTP' 31 ; 32 33 DATA _NULL_; 34 INFILE in; 35 INPUT HOUSEHOLD_ID; 36 RUN; NOTE: cd /Babloo_SFTP/IN/SNAP/CAT_20170705171730.txt 2 The SAS System 08:49 Wednesday, July 5, 2017 ERROR: Directory or file /Babloo_SFTP/IN/SNAP/CAT_20170705171730.txt doesn't exist. NOTE: The SAS System stopped processing this step because of errors.
07-07-2017 07:52 AM
WOULD YOU PLEASE CARE TO READ AND IMPLEMENT MY POSTS?
Drop the "Babloo_SFTP@" from the hostname!!!
07-07-2017 07:54 AM
07-07-2017 08:03 AM
Since you probably don't want to reveal the real host-/user/filenames so we could test from our SAS (or the server won't be reachable from outside), it's best you open a track with SAS technical support.