Hi folks,
I have been following the SAS documentation on this link , especially example 6 to the below code:
filename output sftp lsa
host="sftphost"
optionsx='pw "somepw"' user="userid" debug;
data temp;
infile output truncover;
input a $200.;;
run;
Basically, I am just trying to connect to the server and list all the files under the working directory, but I got the error message saying "ERROR: Directory or file ls -a w "somepw" userid@sftphost doesn't exist.". So, what am I missing here?
Did you see these notes?
I don't see any of those notes. I did validate the username and password using WinSCP client.
Those NOTEs are part of the documentation of FILENAME Statement: SFTP Access Method
You must set up passwordless authentication with your local (on the SAS server) sftp client first, using a public/private keypair.
Since SAS uses an external sftp client which does not accept a password on the commandline (for security reasons, commandlines appear in the public process list), you cannot specify a password at all.
FILENAME FTP allows this because the whole FTP code is integrated within SAS.
The -pw (note the dash) option in example 6 specifies a pass phrase needed to open the .ppk file containing the private key. It is an option internal to WinSCP, and has nothing to do with an sftp password used to log on to a server.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.