I have two servers - SasApp1 & SASApp2, and they sit on Linux. I can select the server I want to connect to with SAS EG and run the SAS code. Can I do it with SAS code instead of choosing a server through the SAS EG options?
Here is the pseudocode of what I'm after:
%IF &SomeMacroToIdentifyServer = SASApp1 %THEN %DO; .....Deselect/Disconnect from SASApp1..... .....Select/Connect to SASApp2..... .....Run data/Proc steps..... .....Deselect/Disconnect from SASApp2..... .....Select/Reconnect to SASApp1..... %END; %ELSE DO; .....Run data/Proc steps..... %END;
This is because SASApp2 has the correct configurations for PROC HTTP calls to SharePoint, and SASApp1 won't allow the connection for reasons I don't know. However, most people use SASApp1 for all of their SAS processes. If there were a programmatic way to switch between the two, we wouldn't have to worry about halting our processes that run in SASApp1 to change to SASApp2 manually and then running the rest of the process involving PROC HTTP.
With EG connection profiles you are unfortunately stuck with that remote SAS server instance and can't change it in SAS code. However if you have SAS/CONNECT licensed, you can SIGNON to a second SAS server session from your existing one and that can be any defined SAS server instance. Run this program to confirm if SAS/CONNECT is available to you:
proc product_status;
run;
proc setinit:
run;
Why don't you talk to your SAS administrator about the PROC HTTP connection problem to see if it can be fixed?
That's good news. The idea would be to connect from EG to your primary SAS server. You then use SIGNON to start a session on the other SAS server and use RSUBMIT blocks to run code there. Something like this:
signon Server2;
rsubmit;
<code to run on Server2>
endrsubmit;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.