BookmarkSubscribeRSS Feed
Stamp0307
Fluorite | Level 6

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. 

4 REPLIES 4
SASKiwi
PROC Star

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? 

Stamp0307
Fluorite | Level 6
Sorry for the delay; I've been out of town. I do have SAS/CONNECT. I've seen the SIGNON method, but it's been a while. I reached out to my admin and hoped for a good turnout.
SASKiwi
PROC Star

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;
Stamp0307
Fluorite | Level 6
Ok, I remember those with the rsubmit and endrsubmit. I will check it out. Thank you!

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 459 views
  • 2 likes
  • 2 in conversation