I would be so appreciate if someone can help me to fix this issue.
Currently I'm trying to use sas to connect to sftp server. I did some researches, it said in order to use sftp method, I need to install openSSH client software and use key authentication for connection.
So I installed puTTY and setup the private/public key. When I test the connection from psftp, I can connect to sftp server without password (use key authentication). As you can see as below, the test file 3.xlsx is on the sftp server.
But the problem is when I try to get the same file on sas, it has an error "the file does not exist".
Inside psftp, I could download this test file on my local pc, I have no idea why I cant do the same thing on sas.
Below is my sas sftp connection code:
filename test sftp '/3.xlsx'
optionsx='-P 222 -i x:\PuTTY\privatekey.ppk -pw "XXXXXXX" -V'
host="XXXXXXXX" user="XXXXXXXX" path="x:\PuTTY\psftp.exe" DEBUG;
I would be so appreciate if someone can help me to fix this issue.
By any chance did you try starting that filename statement with
filename test sftp '3.xlsx'
no preceding /
I tried, its not working. Even if I just want to test with simple cmd like 'LS', I still get error msg like "file '' does not exist'.
I don't know enough, basically nothing, about Putty.
Had you found either of these:
https://www.lexjansen.com/sesug/2017/CC-115.pdf
https://amadeus.co.uk/tips/retrieving-files-from-an-sftp-site/
That seem to provide more concrete details.
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.