DATA Step, Macro, Functions and more

How to programmatically know which server an SAS program is running?

Reply
Contributor
Posts: 24

How to programmatically know which server an SAS program is running?

Hi all,

I need to conditionally connect to different SQL Server in SAS programs based on the server the SAS porgram runs. How to get the server identifying information?

Thanks a lot in advance!

Trusted Advisor
Posts: 2,115

How to programmatically know which server an SAS program is running?

Check out this thread, it has several automatic variables that might help

http://communities.sas.com/thread/14759

SAS Employee
Posts: 104

How to programmatically know which server an SAS program is running?

Automatic macro variables are the key.  SYSHOSTNAME holds the name of the server running SAS, and SYSSCP and SYSSCPL reveal the operating system under which SAS it executing.  Try something like this:

data _NULL_;

   PUTLOG "NOTE: This is execuing on server &SYSHOSTNAME";

   PUTLOG "NOTE: SAS is running under &SYSSCPL &SYSSCPL";

run;

Frequent Contributor
Posts: 139

How to programmatically know which server an SAS program is running?

%syshost can be used .i am currently using this automatic macro variable.

Ask a Question
Discussion stats
  • 3 replies
  • 175 views
  • 0 likes
  • 4 in conversation