List Job (QUSLJOB) API


  Required Parameter Group:


  Optional Parameter Group 1:


  Optional Parameter Group 2:


  Optional Parameter Group 3:


  Default Public Authority: *USE

  Threadsafe: Conditional; see Usage Notes.

The List Job (QUSLJOB) API generates a list of all or some jobs on the system. The generated list replaces any existing list in the user space.

The QUSLJOB API produces a list similar to the list produced by the Work with User Job (WRKUSRJOB) command.


Authorities and Locks

User Space Authority
*CHANGE

Library Authority
*EXECUTE

User Space Lock
*EXCLRD

Job Authority
If format JOBL0200 is specified, then for each job for which information is retrieved, the caller of the API must be running under a user profile that is the same as the job user identity of the job for which the information is being retrieved. Otherwise, the caller of the API must be running under a user profile that has job control (*JOBCTL) special authority.

The job user identity is the name of the user profile by which a job is known to other jobs. It is described in more detail in the Work management topic collection.


Required Parameter Group

Qualified user space name
INPUT; CHAR(20)

The user space that is to receive the generated list, and the library in which it is located. The first 10 characters contain the user space name, and the second 10 characters contain the library name. You can use these special values for the library name:


Format name
INPUT; CHAR(8)

The format of the job list to be returned. If format JOBL0200 is specified, the fields that were selected by the caller will be returned for each job in the list. This format is slower than the JOBL0100 format. The performance will vary depending on the number of fields selected.

You must use one of the following format names:

For more information, see Format of the Generated List.

Qualified job name
INPUT; CHAR(26)

The name of the job to be included in the list. The qualified job name has three parts:


Status
INPUT; CHAR(10)

The status of the jobs to be included in the list. The special values supported are:


Optional Parameter Group 1

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter. If this parameter is omitted, diagnostic and escape messages are issued to the application.


Optional Parameter Group 2

Job type
INPUT; CHAR(1)

The type of job to be listed. Refer to Comparing Job Type and Subtype with the Work with Active Job Command in the Retrieve Job Information (QUSRJOBI) API for information about how the job type field and the job subtype field equate to the type field in the Work with Active Job (WRKACTJOB) command.

The possible values for this parameter are:


Number of fields to return
INPUT; BINARY(4)

The number of fields to return in the JOBL0200 format. This parameter is only used for the JOBL0200 format. If JOBL0100 is specified for the format name, the value must be zero.

Key of fields to be returned
INPUT; ARRAY(*) of BINARY(4)

The list of the fields to be returned in the JOBL0200 format. For a list of the valid fields, see Valid Keys. This parameter is used for the JOBL0200 format only. If JOBL0100 is specified for the format name, the value must be zero.


Optional Parameter Group 3

Continuation handle
INPUT; CHAR(48)

The value returned to the user in the header section when a partial list is returned. The possible values are:


Format of the Generated List

The job list consists of:

For details about the user area and generic header, see User spaces. For details about the remaining items, see the following sections. For detailed descriptions of the fields in the list returned, see Field Descriptions.

When you retrieve list entry information from a user space, you should use the entry size returned in the generic header. The size of each entry may be padded at the end. If you do not use the entry size, the result may not be valid. For examples of how to process lists, see Examples: APIs and exit programs.


Input Parameter Section



Header Section



JOBL0100 Format



JOBL0200 Format



Field Descriptions

Data. The data returned for the key field.

Format name specified. The format name as specified in the call to the API.

Internal job identifier. A value sent to other APIs to speed the process of locating the job on the system. Only APIs described in this topic use this identifier. The identifier is not valid following an initial program load (IPL). If you attempt to use it after an IPL, an exception occurs.

Job information status. Whether the information was available for the job. The possible values are:

Job name specified. The name of the job as specified in the call to the API.

Job name used. The name of the job as identified to the system. For an interactive job, the system assigns the job the name of the work station where the job started; for a batch job, you specify the name in the command when you submit the job.

Job number specified. The job number as specified in the call to the API.

Job number used. The system-assigned job number.

Job subtype. Additional information about the job type (if any exists). Refer to Comparing Job Type and Subtype with the Work with Active Job Command in the Retrieve Job Information (QUSRJOBI) API for information about how the job type field and the job subtype field equate to the type field in the Work with Active Job (WRKACTJOB) command. The possible values are:

Job type. The type of job. Refer to Comparing Job Type and Subtype with the Work with Active Job Command in the Retrieve Job Information (QUSRJOBI) API for information about how the job type field and the job subtype field equate to the type field in the Work with Active Job (WRKACTJOB) command. The possible values for this field are:

Job type specified. The job type as specified in the call to the API.

Key field. The field returned. See Valid Keys for the list of valid keys.

Key of fields to return specified. The key of fields to return as specified in the call to the API.

Length of data. The length of the data returned for the field.

Length of field information returned. The total length of information returned for this field. This value is used to increment to the next field in the list.

Number of fields returned. The number of fields returned to the application.

Number of fields to return specified. The number of fields to return as specified in the call to the API.

Reserved. An ignored field.

Status. The status of the job. The valid values are:

Type of data. The type of data returned.

User name specified. The user name as specified in the call to the API.

User name used. The user profile under which the job is run. The user name is the same as the user profile name and can come from several different sources depending on the type of job.

User space library specified. The name of the library containing the user space as specified in the call to the API.

User space specified. The name of the user space as specified in the call to the API.


Valid Keys

The following table contains a list of the valid keys. The descriptions of all the valid key attributes are described in Work Management API Attribute Descriptions (WMAttrDesc).



Usage Notes

The conditions under which this API is threadsafe are the same as those described in the Usage Notes for the Retrieve Job Information (QUSRJOBI) API.


Error Messages



API introduced: V1R3

[ Back to top | Work Management APIs | APIs by category ]