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?
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.
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
Thanks for the inputs. Let me try and will get back to you.
Can you use the Tasks | Data | Upload Data Files to Server task to use EG to transfer your data?
Tom
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.
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()'.
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.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.