userID

The sysVar.userID system variable contains the user's login ID, where available. For example, you can use this variable to keep track of the activities of specific users on a system, or to permit a user to enter a password only (and not a user ID) when connecting to a database. For platform-specific information, see "Compatibility" later in this topic.

Characteristics

sysVar.userID has the following characteristics:
Primitive type
CHAR
Data length
8 (padded with blanks if the value has less than 8 characters)
Value saved across segmented converse?
Yes

Example

  myVar = sysVar.userID;

Compatibility

Table 1. Compatibility considerations for sysVar.userID
Platform Issue
Java™ generation sysVar.userID is initialized from the user.name Java Virtual Machine system property ; and if the property cannot be retrieved, sysVar.userID is blank.
CICS® sysVar.userID contains the CICS user ID. If the user signed on to the system, sysVar.userID contains the user ID specified at sign-on. When RACF® is installed, sysVar.userID is the RACF user ID. If the user did not sign on, sysVar.userID is blank.
IMS™ BMP
  • If the program runs as an IMS batch-oriented BMP, sysVar.userID contains the job name from the JOB card.
  • If the program runs as an IMS transaction-oriented BMP, sysVar.userID is initialized to the name of the job from the JOB card of the JCL. It is updated with the user ID field from the I/O PCB each time there is a successful get next statement to read a serial file associated with the I/O PCB. The user ID field is blank if sign-on security is not active on the system.
IMS/VS sysVar.userID contains the user ID field from the I/O PCB. sysVar.userID is updated whenever there is a successful get unique (GU) call to the I/O PCB. This is caused by a get next for a serial file associated with the I/O PCB, a converse statement, or the retrieval of the input form when the program starts. sysVar.userID is set to blanks if a get next for a serial file associated with the I/O PCB results in an endOfFile (GC status code). The user ID field is blank if sign-on security is not active on the system.
iSeries® COBOL sysVar.userID contains the user ID specified at sign-on.
z/OS® batch COBOL sysVar.userID contains the job name from the JOB card.
Debug sysVar.userID is initialized based on the userID debug preference. For information on using the debugger, refer to the EGL Programmer's Guide. If this preference is not set, debug selects a default sysVar.userID in the same way that Java generation does.

Feedback