11-05-2014 03:31 PM
In SAS EG, when selecting a remote server as the Selected Sever, I understand any macros that were defined locally within that project (Selected Server Local) aren't copied/defined to the remote server.
I am interested in copying/defining these macros on the remote server without having to copy the local SAS programs w/ embedded macros to the remote server.
In SAS EG, I understand you’re able to attach a local external SAS program to the project and run that code on the server. However, if you have those embedded macros grouped by separate SAS programs, you may not use the %include statement to batch define them as they will try to reference the remote server location rather than the location of that local external SAS program.
Thanks for your help in advance.
11-05-2014 04:33 PM
In many server scenarios, there is a SASEnvironment directory on the server, with subdirectories for SASFormats, SASMacros and code snippets. If you have write access to that directory location, then you could copy your macro code to the server location and then either %INCLUDE it from there or define the location as an AUTOCALL location. But that is going to require the cooperation of your SAS Admin to give you the write (and right) access.
11-05-2014 05:00 PM
to follow Cynthia's suggestion
store your macros anywhere on the server that you are allowed to write - usually there is a home folder on unix. I don't know of software that would synchronize a local windows folder (in reach of your "local" sas server) with your "remote" server, but that is the functionality which would make it all simple.
Assuming you do not have that facility, when you finish adapting a macro, store it not only in a folder near the "local EG server" but also in a folder within reach of the "remote EG server".
When running in these environments, use the INSERT or APPEND system options to add the path to your macros to the SASAUTOS option. That eliminates the need for any %include of the macros.
You only want to do this when EG reconnects to the server - there is an option for that
at menu: /Tools/SAS programs/
select "Submit SAS code when server is connected"
Depending on the server use code like this
option insert= sasautos 'c:\temp\path\to\your\macros' ;
option insert= sasautos '~/your/macros' ;
If it is not server specific, you can retrieve the &_SASSERVERNAME macro variable to enable the correct code to be selected
11-05-2014 09:56 PM
Additionally to what already has been proposed:
In case these are all Windows environments you could eventually get away by using UNC paths which then are the same both from your local and remote SAS environment. If this works then you could execute all your stuff together on either of the 2 servers.
or libname ... '<\\SERVER\SHARE\FOLDER\FILEPATH>';
If you really need to use a local and a remote session together and have them exchange stuff then you would need to have SAS/Connect licensed (using RSUBMIT) and you would have to code quite a bit to make things work.