06-18-2015 04:27 PM
Right now, whenever I want to bring a data set from the server workspace to the local workspace, I have to point and click on the data set to build a query and then choose the local server. Are there any code lines that can achieve this task so that I can put them in my run and therefore do not have to do the point-and-click anymore?
06-18-2015 06:04 PM
As I understand it the only way to transfer SAS data in EG is to use the EG transfer data tasks. These do not run SAS code behind the scenes, so unfortunately there is no code-based alternative.
If you can access your remote SAS server data folders from your PC (most likely if your SAS server runs on Windows), you could assign a LIBNAME for the remote folder and read your SAS data that way:
libname remote "\\SASServerName\SASDataFolder";
libname local "C:\SASDataFolder";
proc copy in = remote out = local;
06-18-2015 09:14 PM
To establish direct SAS Server to SAS Server communication you need SAS/Connect licensed and installed. If that's the case then you can transfer data between servers using SAS code.
06-18-2015 09:45 PM
In Patricks solution you would also need to switch to using the SAS Display Manager client for data transfers in code - the UPLOAD and DOWNLOAD procedures.
Using EG would only be possible if you could CONNECT from your remote SAS server back to your PC in which case you could UPLOAD and DOWNLOAD to your PC via remote SUBMITs.
06-18-2015 10:51 PM
True. That would require switching to Display Manager though which the OP may or may not want to do.
SAS/CONNECT and EG don't know about each other even when you have both a local and remote SAS server. With EG you could run a program on the remote SAS server that RSUBMIT's back to your PC and UPLOADs SAS data (its an upload in this case because your PC is the server and EG SAS remote server is the client - confusing) to it. I'm not able to try it though as I have no local SAS only EG - a common scenario these days.
06-19-2015 12:27 AM
I don't really get why things shouldn't work with EG. The EG client is simply sending code to a server for execution (be it local or remote). So if you send code to a local server and then in this code is the connection to the remote server done (withing an rsubmit block) why shouldn't that work?
I don't think it will be possible to connect from a remote server to a local server (run on a local machine). That's something most sites won't allow.
I believe with more modern versions of EG it's now also possible to run different nodes in the same flow against different servers. So another option using EG would be to write to a permanent tables in the one node under the remote server to a location which is also accessible to the local server - and then in the next node access this data via the local server.
06-19-2015 01:53 AM
This is what we usually do , our SAS resides on the Unix Server and we use rsubmit to execute the code at the unix end.
For the Datasets , we create a libname inside the rsubmit block and we refer the same libname outside the rsubmit by using another libname . like
libname test_dat '/home/user/xxxyyy/ttttt/';
libname test_dat slibref = test_dat server = unix; (We name our server as unix while establishing the connection)
That's it ... you're free to use the remote datasets like the local datasets , but beware of the file sizes. The approach works well for smaller datasets , for larger files I would use a ftp tool and move the datasets to local.