BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tom_Truong
Calcite | Level 5

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.

1 ACCEPTED SOLUTION
4 REPLIES 4
ChrisHemedinger
Community Manager

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.

SAS Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.
Kurt_Bremser
Super User

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.

Tom_Truong
Calcite | Level 5

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.

Ready to join fellow brilliant minds for the SAS Hackathon?

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!
How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 491 views
  • 0 likes
  • 3 in conversation