I need to find whether the user has signed on to any server from PC SAS. I could do it with the server name which is signed on, by getting it from a macro variable. But I would need to do it without using the server name macro variable.
So, is it possible to just know whether any server is remotely signed on from PC SAS by using set of SAS Base or SCL code?
Thanks!
-Sudharsanan
If you mean active SAS/CONNECT or workspace server sessions, you best call a shell script and read the output.
eg
filename oscmd pipe "ps -ef|grep grlink";
data connectusers;
infile oscmd;
length user $ 8;
input user;
run;
grlink is typical for SAS/connect commandlines, you can use any other option that is indicative of the processtype you wish to list ('bridge spawned' for workspace servers)
This method is for UNIX servers, and you may have to tinker with the ps options depending on which UNIX you are on. ps -ef is for AIX. Don't know how to get it via commandline on windows.
@KurtBremser Thanks for your reply. I think "ps -ef|grep grlink" is a unix command. I think the code provided are for Unix server, may be used by remote submitting to a Unix server for PC SAS.
To be clear on my question, from my Windows SAS Base, I need to find whether any server (mostly Unix server) is signed on already or not. I need to do the verification before remote submitting any statements to the signed on server.
So what you want to know is if, in your current SAS session on windows, you have already established a SAS/CONNECT connection to one of the defined servers which reside on any platform?
Perhaps the CMACVAR= option could be of help?
and the listtask information? (also documented with SAS/connect) as is waitfor.
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.