05-20-2014 02:45 AM
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?
05-20-2014 02:56 AM
If you mean active SAS/CONNECT or workspace server sessions, you best call a shell script and read the output.
filename oscmd pipe "ps -ef|grep grlink";
length user $ 8;
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.
05-20-2014 03:05 AM
@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.
05-20-2014 03:14 AM
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?
05-20-2014 03:36 AM
Perhaps the CMACVAR= option could be of help?