Do not use backslashes on UNIX commandlines. A backslash has a very special meaning for UNIX shells and must not be used for anything else.
But I repeat: log on to the UNIX server and run the sftp from the commandline until it works. Then start using it in SAS code.
Start with logging on in interactive mode by simply doing
sftp user@servername
Then retrieve a file with the subcommand get (you can use most of the FTP subcommands in sftp). From that you should be able to create the commandline non-interactive version.
Disclaimer: I retrieve my data from a sane operating system (Linux), not from any Windows, so I have no idea how filenames need to be formulated so that the Dumb Operating System understands it.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.