Desktop productivity for business analysts and programmers

EG user session table - PID, user, start timestamp, and work library path

Reply
Occasional Contributor
Posts: 14

EG user session table - PID, user, start timestamp, and work library path

Hi All,

I'm trying to create a user session table (a text file would also be fine) for managing user sessions, in particular for correlating orphan processes and work libraries to users. I'm trying to have each EG user session update a table that contains four pieces of information - the user, the PID, the start date and time, and the work library path. The code below generates the table, but when i put it into my workspace server's autoexec_usermods.sas my EG session can't see any libraries (the library icon in the server tree view is visible, but when i try to expand it the + just disappears without showing any libraries).

Has anyone built something similar, or used a mechanism other than the autoexec_usermods.sas to run code for each EG user session?

Thanks,
Nick

data myinfo;
length pid $ 8 user $ 16;
pid="&sysjobid";
user="&sysuserid";
sdate="&sysdate";
stime="&systime";
length work $ 255;
work=&sasworklocation;
run;

libname t '/usr/local/sasv9/EBI9.2/Lev1/SASApp/pidlog';

proc append base=t.pidlog data=myinfo force;
run;
libname t;
Community Manager
Posts: 2,889

Re: EG user session table - PID, user, start timestamp, and work library path

Nick,

Autoexec processing is too early in the process to have the effect you want.

You would need to add this to the "Submit statements when server connected" option within EG's Tools->Options->SAS Programs. I know that's tricky to do for a whole bunch of users, but you need this to happen from EG after the SAS session is established and EG has created its macro variables (like &sasworklocation).

You might be able to store the program in a central location, and add a %include statement to the "Submit statements" option. Then if you have to change the program later, you don't need to hit all of those desktops.

Chris
SAS Employee
Posts: 25

Re: EG user session table - PID, user, start timestamp, and work library path

You can use your code in an autoexec with one minor change - as Chris noted, the EG macro variables will not be available, but you can use:

work=pathname('WORK') ;

to get the location of the SAS WORK library for the session.
Contributor
Posts: 66

Re: EG user session table - PID, user, start timestamp, and work library path

We did something similar in the appserver autoexec with 9.1. We recorded the Process ID, Work Path and User ID etc. Basically whenever a user initiated a session with SAS from any client application that used the autoexec you got a record. The dataset grew really fast and we had some issues with causing DI jobs running in parallel to fail. It was fun to see the people who like to open 10 sessions of EGuide at once though Smiley Happy
Occasional Contributor
Posts: 19

Re: EG user session table - PID, user, start timestamp, and work library path

Hi Cameron ,

The implementation you have mentioned is what I need... I need to get PID , session login time , log off time , userID etc. But I dont have any idea about how I can get these for every EG session ? If you can help me , I will be realy grateful.

Thank you

Selçuk.

Ask a Question
Discussion stats
  • 4 replies
  • 1123 views
  • 0 likes
  • 5 in conversation