Desktop productivity for business analysts and programmers

How to write Putty commands in SAS EG

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 9
Accepted Solution

How to write Putty commands in SAS EG

My situation is -

 

I have SAS EG installed and have only remote server connected to execute any program. I need to set-up a process on data upload in SAS EG. Currently, I use putty to transfer the data from local server to remote server.

 

Question -

Is it possible to open and write putty commands in SAS EG (which has only remote server connection)? If yes, how to do it? Will you please share some sample code for it?

 


Accepted Solutions
Solution
‎03-28-2016 07:54 AM
Grand Advisor
Posts: 17,459

Re: How to write Putty commands in SAS EG


All Replies
Esteemed Advisor
Esteemed Advisor
Posts: 7,253

Re: How to write Putty commands in SAS EG

Right, well I don't use EG, so I don't know the restrictions behind that, nor do I know your setup/priviledges etc.  This should really be discussed with your IT group, so as everything has the access it needs, and things are setup in a good and validated method.

 

Now in Base SAS, you can send commands out the the Operating system, either by using file:

filename mypipe pipe 'dir "c:\tmp"';

 

When read into SAS the dir c:\tmp is sent to the OS, and the contents returned.  There is also:

call system()

Which does a similar thing.  Now, so long as you have this "Putty" installed, and you have access to the main executable file, and the paths associated with the transfers, then all you need to do is construct the command line, and send it out to the system.

This shows how to use the command line:

http://the.earth.li/~sgtatham/putty/0.53b/htmldoc/Chapter3.html

http://etherealmind.com/putty-command-line/

 

If none of the above makes any sense to you then I strongly advise you let your IT group handle this.

Super User
Posts: 1,102

Re: How to write Putty commands in SAS EG

Hi,

 

asyou have been advised, first you need to have permissions to run x commands (XCMD option), but I don't believe that was your question.

 

To simplify my answer, what you will need is to create an external file with all the ssh commands (which can be created with SAS or be just an static file), then call:

 

putty.exe -ssh [domain name] -l [username] -pw [password] -m [the directory of the .txt file you created which contains the codes you want to be executed].

 

Besides:

You might prefer to use plink.exe  (from the PuTTY web page) and not putty.exe

Without plink, the only way is to use the -log <logfile> options and then print its content and delete it.

 

The problem with this option is that it will print the username and password in the logs. Probably there is an option to use a secured profile instead

Occasional Contributor
Posts: 9

Re: How to write Putty commands in SAS EG

Thanks for the inputs. Let me try and will get back to you.

 

 

Trusted Advisor
Posts: 1,061

Re: How to write Putty commands in SAS EG

Can you use the Tasks | Data | Upload Data Files to Server task to use EG to transfer your data?

 

Tom

Occasional Contributor
Posts: 9

Re: How to write Putty commands in SAS EG

upload data file - can be able to load only the sas data file not other external files like (csv, txt and excel)
Occasional Contributor
Posts: 9

Re: How to write Putty commands in SAS EG

i also have a question, do we need to have local and remote server connection established in the SAS EG to transfer the file from local machine to remote. Right now i have only remote server connection to execute my program. Please let me know your thoughts
Solution
‎03-28-2016 07:54 AM
Grand Advisor
Posts: 17,459

Re: How to write Putty commands in SAS EG

Occasional Contributor
Posts: 9

Re: How to write Putty commands in SAS EG

I have also gone through this blog. I dont know how to invoke copy file pop-up window. Could you please help me with that? I also have a question, do we need to have both local and remote server connection established for upload and download the data.
Community Manager
Posts: 2,707

Re: How to write Putty commands in SAS EG

The Data Upload/Download tasks don't need a local SAS to work.  And neither does the Copy Files task (which you have to download and install from my blog).

 

I think the Copy Files task is what you want to use -- that's a widely used task that thousands of users (my estimate!) have found to fit the need for copying files between a local PC and the remote SAS server.

 

If you're having trouble getting the task to show in your Tools->Add-In menu, you might be missing the "unblock DLL" step.

Occasional Contributor
Posts: 9

Re: How to write Putty commands in SAS EG

[ Edited ]

After placing all the DLL files in the specified folder and also unblocked
the DLL files. I'm able to see the add-in File transfer task but getting an
error msg while i try to open it.

The error msg is Method not found: 'void SAS.EG.SDS.Model.Broker..ctor()'.

Community Manager
Posts: 2,707

Re: How to write Putty commands in SAS EG

You need to put only one of the DLL files into the Custom folder.  Select the version that matches your SAS Enterprise Guide version, and delete the others.  I think right now you have conflicting versions of this custom task installed.

Occasional Contributor
Posts: 9

Re: How to write Putty commands in SAS EG

Thanks. Its working fine. Will be possible to add different remote server
which is not connected by SAS EG. For an example, I have load some external
file from local server to different server which is not connected with SAS
EG. And also one more question, is it possible to convert this menu driven
to SAS code.

Thank you so much again.
☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 12 replies
  • 1231 views
  • 3 likes
  • 6 in conversation