I followed the instruction here (https://go.documentation.sas.com/?docsetId=lestmtsglobal&docsetTarget=p0xln1fiwsr340n1xxf4mkmfxp6f.h...) to connect to a server at Nonstandard port.
Here is my code:
FILENAME rmt sftp "datafile_today.zip"
options="-oPort=100"
host='serverIP'
user='myuserid'
wait_milliseconds=100000
cd='/'
recfm=s
debug;
Here is the error that I had in the Log:
NOTE: psftp: unknown option "-oPort=100" try typing "psftp -h" for help
NOTE: cd "/"
ERROR: Directory or file datafile_today.zip doesn't exist.
Updates:
After looking for possible solutions for this issue, I updated my SAS code to be as below:
FILENAME rmt sftp "90391660_DigitalData_20190410.zip"
options="-P = 100"
host='serverIP'
user='myuserid'
wait_milliseconds=100000
recfm=s
options="-v"
debug;
However, SAS can't recognize the port option. From the error message in the log, SAS was trying to connect to the server at a standard port 22. See log below:
NOTE: Looking up host "ServerIP" for SSH connectionConnecting to ServerIP port 22 We claim version:
SSH-2.0-PuTTY_Release_0.71
NOTE: Network error: Network error: Software caused connection abortFATAL ERROR: Network error: Network error: Software caused
connection abort
Any ideas are appreciated!
Have you tried testing this on a command line: psftp -P=100? If it works from a command line then it will likely work in SAS.
Failing that SAS Tech Support might be your best bet.
Yes, it worked in the command line.
I wrote a winscp script to do the work instead of doing it in SAS.
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!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.