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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.