BookmarkSubscribeRSS Feed
MaryPet123
Calcite | Level 5

Hello All,

Looking for some assistance with the SFTP processing in SAS. We have a requirement to use secure FTP to read SMF data from a mainframe lpar. Our jobs are initiated from a windows PC and the standard FTP in SAS works fine however when we attempt to read same file using SFTP we get errors on the PASS and RCMD commands. Attempting to run this without those two commands does not work either. Has anyone managed to get this to work? The file is variable block spanned and sometimes resides on TAPE (albeit virtual) so additional parameters may be required as well but we have not been able to get any to work. 

Any assistance is appreciated.

Sample Code: 


FILENAME SMF SFTP ("'XXX.XXX.XXX.G0037V00'")
USER='USER123' HOST='102.102.1.102' DEBUG
S370VS RCMD='SITE RDW;SITE READTAPEFORMAT=S' LRECL=32760
PASS='Passw@rd';

3 REPLIES 3
ballardw
Super User

Doesn't work is awful vague.

Are there errors in the log?: Post the code and log in a code box opened with the {i} to maintain formatting of error messages.

No output? Post any log in a code box.

Unexpected output? Provide input data in the form of a dataset, the actual results and the expected results. Data should be in the form of a data step. Instructions here: https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-dat... will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the {i} icon or attached as text to show exactly what you have and that we can test code against.

Kurt_Bremser
Super User

SFTP from SAS needs public/private key authentication, so the connection is established without a password. Since SAS uses an external SFTP client for the transfer, establish passwordless authentication there first, and then try from SAS again.

Kurt_Bremser
Super User

And an addendum: the SFTP protocol does not support all messages/commands found in the FTP protocol. Therefore certain options like RCMD are not available when using sftp.

So a sideeffect of switching to SFTP on the mainframe might be that you need to convert files to a format suitable for SFTP before you try to read them from SAS. eg FB so you can read with recfm=f and a suitable lrecl=.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 3 replies
  • 1669 views
  • 0 likes
  • 3 in conversation