I'm trying to SFTP files(SAS datasets or tokens) from one server to another server in SAS

前端 未结 2 1279
天涯浪人
天涯浪人 2021-01-20 06:12

This is first time I\'m trying to SFTP files using SAS.I tried using filename statement but getting some errors.

%let _user=userid;
  filename source sftp \'         


        
相关标签:
2条回答
  • 2021-01-20 06:30

    As Dom notes, you're not intended to include a password in your code to connect via SFTP, and as such the option isn't (mostly) supported. See the documentation on the filename SFTP access method for more information.

    In order to set up a public key authentication method, you need a SSH key pair to be generated. The server owner needs to do this; if that's you, you can find instructions for doing that online, such as [here]1(http://www.hasug.org/newsletters/hasug201202/Using_Secure_Shell_with_SASr_Software.pdf). SAS also has a thorough document including instructions for this process on a technical support site here.

    Once the SSH key is provided to you, you save it in the appropriate location depending on your environment, and log in once interactively using PuTTY or another SSH client. See that client's documentation for exactly where to put the SSH public key file. When you log in using that public key, you may be prompted to add it to your computer's permanently approved list (say yes).

    You can also see this SuperUser question which has a similar set of instructions.

    1Rickards,Clint, "Using Secure Shell with SAS Software", HASUG 2012.

    0 讨论(0)
  • 2021-01-20 06:38

    the SFTP Filename engine does not have a password parameter. SAS recommends using public key authentication.

    You can use the optionsx='-pw "YourP@ssw0rd!"' option, if you need to supply a password. optionsx will XXX out the values in the Log.

    0 讨论(0)
提交回复
热议问题