%let mywk=%sysfunc(getoption(WORK));
%let target_folder=/###/####/;
%let source_folder=/sas/shared/#####/;
%let source=ARRIVALS.xls;
data _null_;
file "&mywk/get_aff.cmd";
put "user #####";
put "cd &target_folder." ;
put "lcd &source_folder" ;
put "put &source.";
put "ls -l";
put "quit";
filename doftp pipe "sftp -v sfs.company.com < &mywk/get_aff.cmd";
;
run; The corresponding log if here: NOTE: <<< 230 User ###### logged in. NOTE: >>> OPTS UTF8 ON NOTE: <<< 200 OPTS command successful NOTE: >>> OPTS UTF8 NLST NOTE: <<< 501 OPTS: parameters are incorrect NOTE: >>> OPTS UTF-8 NLST NOTE: <<< 501 OPTS: parameters are incorrect NOTE: >>> PASV NOTE: <<< 227 Entering Passive Mode (######) NOTE: >>> TYPE A NOTE: <<< 200 TYPE command successful NOTE: >>> CWD /Distribution/WVR_Associate_Sites/OVI NOTE: <<< 250 CWD command successful NOTE: >>> PWD NOTE: <<< 257 "/####/#####/" is current directory NOTE: >>> PBSZ 0 NOTE: <<< 200 PBSZ command successful NOTE: >>> PROT P NOTE: <<< 200 PROT command successful NOTE: >>> RETR /sas/shared/####/ARRIVALS.xls NOTE: <<< 550 RETR failed: File could not be found ERROR: Physical file does not exist, /sas/shared/####/ARRIVALS.xls.
... View more