UserIdentifier (MQCHAR12)
This is part of the identity context of the message. For more information about message context, see Overview for MQMD and Message context.
UserIdentifier specifies the user identifier of the application that originated the message. The queue manager treats this information as character data, but does not define the format of it.
After a message has been received, use UserIdentifier in the AlternateUserId field of the ObjDesc parameter of a subsequent MQOPEN or MQPUT1 call to perform the authorization check for the UserIdentifier user instead of the application performing the open.
When the queue manager generates this information for an MQPUT or MQPUT1 call:- On z/OS®, the queue manager uses the AlternateUserId from the ObjDesc parameter of the MQOPEN or MQPUT1 call if the MQOO_ALTERNATE_USER_AUTHORITY or MQPMO_ALTERNATE_USER_AUTHORITY option was specified. If the relevant option was not specified, the queue manager uses a user identifier determined from the environment.
- In other environments, the queue manager always uses a user identifier determined from the environment.
- On z/OS, the queue manager uses:
- For MVS (batch), the user identifier from the JES JOB card or started task
- For TSO, the user identifier propagated to the job during job submission
- For CICS®, the user identifier associated with the task
- For IMS, the user identifier depends on the type of application:
- For:
- Nonmessage BMP regions
- Nonmessage IFP regions
- Message BMP and message IFP regions that have not issued a successful GU call
- For:
- Message BMP and message IFP regions that have issued a successful GU call
- MPP regions
- The signed-on user identifier associated with the message
- The logical terminal (LTERM) name
- The user identifier from the region JES JOB card
- The TSO user identifier
- The PSB name
- For:
- On IBM® i, the queue manager uses the name of the user profile associated with the application job.
- On UNIX, the queue manager uses:
- The application's logon name
- The effective user identifier of the process if no logon is available
- The user identifier associated with the transaction, if the application is a CICS transaction
- On Windows systems, the queue manager uses the first 12 characters of the logged-on user name.
This field is normally an output field generated by the queue manager but for an MQPUT or MQPUT1 call we can make this field an input/output field and specify the UserIdentification field instead of letting the queue manager generate this information. Specify either MQPMO_SET_IDENTITY_CONTEXT or MQPMO_SET_ALL_CONTEXT in the PutMsgOpts parameter and specify a user ID in the UserIdentifier field if we do not want the queue manager to generate the UserIdentifier field for an MQPUT or MQPUT1 call.
For the MQPUT and MQPUT1 calls, this is an input/output field if MQPMO_SET_IDENTITY_CONTEXT or MQPMO_SET_ALL_CONTEXT is specified in the PutMsgOpts parameter. Any information following a null character within the field is discarded. The queue manager converts the null character and any following characters to blanks. If MQPMO_SET_IDENTITY_CONTEXT or MQPMO_SET_ALL_CONTEXT is not specified, this field is ignored on input and is an output-only field.
After the successful completion of an MQPUT or MQPUT1 call, this field contains the UserIdentifier that was transmitted with the message if it was put to a queue. This will be the value of UserIdentifier that is kept with the message if it is retained (see description of MQPMO_RETAIN for more details about retained publications) but is not used as the UserIdentifier when the message is sent as a publication to subscribers because they provide a value to override UserIdentifier in all publications sent to them. If the message has no context, the field is entirely blank.
This is an output field for the MQGET call. The length of this field is given by MQ_USER_ID_LENGTH. The initial value of this field is the null string in C, and 12 blank characters in other programming languages.