It does not look like the psftp program does what you want it to do. You can test that by taking SAS out of the problem and issuing the proposed command from a DOS prompt. I think it would be much easier to use SAS to write the script for psftp than to depend on an external file. But you could use an external file as a model for the script that SAS would write. The datastep below will replace all references to '%1' with the actual directory. %let sdir=d:\raj ; filename script temp; data _null_; infile 'abc.bat' ; file script; input; _infile_ = tranwrd(_infile_,'%1',"&sdir"); put _infile_; run; %sysexec psftp.exe username@hostname -p portnumber(22) -pw password -batch -b %sysfunc(pathname(script)) ;
... View more