Usage Note 16932: How to capture userID of user starting a SAS job on a server
To capture the userID of the users who start a SAS session on
a server, create a new autoexec.SAS file and add the following code to
it (or just add the code to an existing autoexec.SAS file).
filename startlog "c:\temp\SASstart.txt" MOD;
data;
file startlog;
put "User &sysuserid ran PID &sysjobid on &sysdate : &systime";
run;
SAS runs the code each time a SAS session is started and appends the
userID, the process identifier (PID), date, and time that the SAS
session started in the file pointed to by the FILENAME statement.
The location and name of the file in the FILENAME statement can be
changed. The verbage in the PUT statement can also be changed to
reflect whatever message you want. The &sysuserid, &sysjobid, &sysdate
and &Ysystime are automatic MACRO variables. They can all be used or
the statement tailored to present just the information needed.
The PID can be used to track down who is submitting code that is
crashing or causing problems on the server:
1. Check the Windows Event Viewer log to see which PID is the culprit.
2. Check the SASstart.txt for the userID.
Operating System and Release Information
| SAS System | Base SAS | Microsoft Windows XP Professional | 9.1 TS1M3 | |
| Microsoft Windows NT Workstation | 9.1 TS1M3 | |
| Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.1 TS1M3 | |
| Microsoft Windows XP 64-bit Edition | 9.1 TS1M3 | |
| Microsoft Windows Server 2003 Enterprise Edition | 9.1 TS1M3 | |
| Microsoft Windows Server 2003 Standard Edition | 9.1 TS1M3 | |
| Microsoft Windows Server 2003 Datacenter Edition | 9.1 TS1M3 | |
| Microsoft Windows 2000 Server | 9.1 TS1M3 | |
| Microsoft Windows 2000 Advanced Server | 9.1 TS1M3 | |
| Microsoft Windows 2000 Datacenter Server | 9.1 TS1M3 | |
| Microsoft Windows 2000 Professional | 9.1 TS1M3 | |
*
For software releases that are not yet generally available, the Fixed
Release is the software release in which the problem is planned to be
fixed.
| Date Modified: | 2006-04-09 12:10:20 |
| Date Created: | 2006-01-24 13:00:26 |