Set Job User Identity (QWTSJUID) API


  Required Parameter:

1 Operation requested Input Binary(4)
2 Error code I/O Char(*)

  Default Public Authority: *EXCLUDE

  Threadsafe: Conditional; see Usage Notes.

The Set Job User Identity (QWTSJUID) API has two operations that can be used to explicitly set the job user identity of the current job. The two operations are set and clear. The set operation explicitly sets the job user identity to the name of the current user profile of the thread in which the API is called. The clear operation clears any job user identity that was previously set by the QWTSJUID API or the QwtSetJuid() function, and the default job user identity will then take effect.

The job user identity is the name of the user profile by which this job is known to other jobs. The job user identity is used for authorization checks when other jobs on the system attempt to operate against this job. Examples of functions that operate against another job include the Start Service Job (STRSRVJOB) command, the Retrieve Job Information (QUSRJOBI) API, the Change Job (QWTCHGJB) API, all job control commands, and functions that send signals from one job to another.

The job user identity is not used to make authorization checks from within this job. Authorization to perform a function is always based on the current user profile of the thread in which the function is called.

This API is intended to be used by either multithreaded servers or single threaded servers that want to establish a job user identity that remains constant, regardless of the user profile under which it processes individual client requests.

When a job user identity has not been explicitly set by an API, a job running single threaded will have a job user identity that is the same as the current user profile that the job is running under at the time. When a job user identity has not been explicitly set by an API, a job running multithreaded will have a job user identity that is the name of the user profile that the job was running under at the time it became multithreaded.


Authorities and Locks

If the job user identity is currently set, then either *USE authority to the user profile associated with the job user identity or all object (*ALLOBJ) special authority is required. If the job user identity is not already set, then no authorization is required.


Required Parameter

Operation requested
INPUT; BINARY(4)

The operation to be performed.

The possible operations are:

1 Set job user identity to the name of the job's current user profile.
2 Clear the job user identity. The default job user identity will now take effect.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


Usage Notes

Thread safety considerations:


Error Messages

Message ID Error Message Text
CPF180B E Function &1 not allowed.
CPF2217 E Not authorized to user profile &1.
CPF3C36 E Number of parameters, &1, entered for this API was not valid.
CPF3C3C E Value for parameter &1 not valid.
CPF3C90 E Literal value cannot be changed.
CPF3CF1 E Error code parameter not valid.
CPF9872 E Program or service program &1 in library &2 ended. Reason code &3.


API Introduced: V4R3


[ Back to top | Security APIs | APIs by category ]