Hello,
When I changed the FTP code :
From:
filename BASFILE ftp "'DASP.C.D.CRL.CRLBAS(&GEN.)'"
USER="&SYSUSERID" PASS="&PSWD"
host='PRODPLEX' lrecl=300 recfm=fb ;
To:
filename BASFILE ftp "'DASP.C.D.CRL.CRLBAS(&GEN.)'"
USER="&SYSUSERID" PASS="&PSWD"
host='sftp.tdbank.ca' port=1065 prot=P lrecl=300 recfm=fb ;
I got this error message:
NOTE: 220-TCPSFTP1 IBM FTP CS V2R4 at vipab200.tdbank.ca, 09:15:45 on 2022-04-27.
ERROR: Invalid Reply received for the RETR command..
NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set DATAOUT.BASDATA1 may be incomplete. When this step was stopped there were 0 observations and 98 variables.
9 The SAS System 09:14 Wednesday, April 27, 2022
NOTE: DATA statement used (Total process time):
real time 2:39.55
cpu time 0.04 seconds
ERROR: SAS ended due to errors.
You specified: OPTIONS ERRORABEND;.
Any idea how to overcome this issue. Your help is much appreciated.
You CANNOT supply a password, PERIOD. You MUST establish passwordless authentication first.
SAS has a special FILENAME method for SFTP, documented here.
SFTP requires either OpenSSH or Putty to be set up in your environment already. See the documentation for these details.
You cannot supply a password with the SFTP access method.
Why is this so when the FTP access methods does allow a password?
The FTP access method is coded into the SAS system, but for SFTP, SAS relies on external SSH client software (OpenSSH for UNIX or PuTTY for Windows) and calls this to do the transfer. Since the commandline is openly visible for other processes on a system while a process is active, supplying a password via commandline would be a major security issue, and such programs do not provide this.
So, passwordless authentication with public/private keypairs must be established before you can use SFTP from within SAS.
Hi Kurt,
Much appreciated for your prompt reply.
As i am new to SAS, would you kindly show me a method to pass the password into Mainframe so it will ready when I invoke SFTP.
Thank you so much.
You CANNOT supply a password, PERIOD. You MUST establish passwordless authentication first.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.