Help using Base SAS procedures

Using rc= system

Reply
Contributor
Posts: 59

Using rc= system

Hi,

I am running a below command to create a master tunnel to the server from inside sas. My question is that if I am using an "auto-login" facility , is there a way i can do that through sas by tweaking the below piece of code.

options noxwait noxsync;
data _null_;
rc=system('putty -ssh -L 12355:localhost:3452 domain_name@xyz.com')

Thanks in advance

Tej
Super Contributor
Super Contributor
Posts: 3,174

Re: Using rc= system

A search of the SAS support http://support.sas.com/ website revealed this SAS DOC item which may be of use:

FILENAME Statement, SFTP Access Method
http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a003041481.htm

Scott Barry
SBBWorks, Inc.
Contributor
Posts: 59

Re: Using rc= system

Thanks Scott!

I was able to setup auto-login, however I am troubling you with one more question.
Is there a way I can have SAS execute a specific lines of code everytime I open up a SAS session?

I want to have SAS create that master tunnel to the server through that code eveytime it opens a session

Thank you
Tej
Super Contributor
Posts: 474

Re: Using rc= system

Yes indeed.

The appropriate way would be to include your code into the autoexec file (same directory of your sas executable, or use -autoexec comand line to specify another location).

Check:
http://support.sas.com/documentation/cdl/en/hostunx/61879/HTML/default/a002460936.htm

And:
http://support.sas.com/documentation/cdl/en/hostunx/61879/HTML/default/autoexec.htm

Cheers from Portugal.

Daniel Santos @ www.cgd.pt
Contributor
Posts: 59

Re: Using rc= system

Thanks so much Daniel.

I also wanted to let you know that I was able to create a batch file and accomplish the same with contents as below.

"C:\Program Files\SAS\SAS 9.1\sas.exe" -sysin "C:\login.sas"

Thanks again,
Tej
Occasional Contributor
Posts: 11

Re: Using rc= system

Could you please let me know how you connected to an SFTP, i tried the documentation at the paths provided and they do not work for me.

I dont seem to be able to connect as there is no password option in SAS to do it.

basically all i want to do is connect to an SFTP, i have username and password for this and IP address, then tell sas where to look and then use a command to grab a file... initially though just to connect is my issue.

Hope you can help
Ask a Question
Discussion stats
  • 5 replies
  • 862 views
  • 0 likes
  • 4 in conversation