Open List of Jobs (QGYOLJOB) API


  Required Parameter Group:


  Optional Parameter Group 1:


  Optional Parameter Group 2:


  Default Public Authority: *USE

  Threadsafe: Conditional; see Usage Notes.

The Open List of Jobs (QGYOLJOB) API generates a list of jobs on the system. The list is based on specified selection criteria. The filtered list may then be sorted depending on the value of the sort parameter. Upon successful completion of this API, a handle is returned in the list information parameter. You may use this handle on subsequent calls to the following APIs:


Authorities and Locks

None.


Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable that is used to return the job information.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable. This must be large enough to hold at least one record of information.

Format name
INPUT; CHAR(8)

The format of the job list to be returned. If format OLJB0200 is specified, the fields that are selected by the caller are returned for each job in the list. This format is slower than the OLJB0100 format. The performance varies depending on the number of fields selected.

The possible format names follow:

See Format of Receiver Variable for more information.

Receiver variable definition information
OUTPUT; CHAR(*)

The variable that is used to return the description of how the keyed portion of the list is returned in the receiver variable. This variable is not filled in if the OLJB0100 format is used. See Format of Receiver Variable Definition Information for a description of the layout of this parameter.

Length of receiver variable definition information
INPUT; BINARY(4)

The length of the receiver variable definition information. This must be large enough to hold the information for all key fields that are specified in the key of fields to be returned parameter.

List Information
OUTPUT; CHAR(80)

Information about the list that is created by this program. For a description of the layout of this parameter, see Open list information format.

Number of records to return
INPUT; BINARY(4)

The number of records in the list to put into the receiver variable after filtering and sorting have been done.

Sort information
INPUT; CHAR(*)

Information on what fields within the record of information to sort. See Format of Sort Information for a description of the layout of this parameter.

Job selection information
INPUT; CHAR(*)

Information that is used for selecting which jobs to include in the list. See Format of Job Selection Information for a description on the layout of this parameter.

Size of job selection information
INPUT; BINARY(4)

The size, in bytes, of the job selection information parameter. The minimum value required for this parameter is 60 (or 108 with selection format OLJS0200).

Number of fields to return
INPUT; BINARY(4)

The number of fields to return. If this parameter is 0, the key of fields to be returned parameter is not used, the receiver variable definition information parameter is not modified, and the length of receiver variable definition information must be 0. This field must be set to 0 when the format is set to OLJB0100.

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

The list of the fields to be returned. For a list of valid key fields allowed on the OLJB0200 format, see List of Keys Supported for Format OLJB0200. For a list of valid key fields allowed on the OLJB0300 format, see List of Keys Supported for Format OLJB0300.

Error code
I/O; CHAR(*)

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


Optional Parameter Group 1

Job selection format name
INPUT; CHAR(8)

The format of the job selection information input. If this parameter is not specified, the OLJS0100 format is used. The possible format names follow:

See the Format of Job Selection Information for more information.


Optional Parameter Group 2

Optional Parameter Group 2 applies only when the format is OLJB0300.

Reset status statistics
INPUT; CHAR(1)

The elapsed time and all the key fields that are based on the elapsed time are reset to zero. If a format other than OLJB0300 is specified, this field needs to be zero. The default value for this field is zero. The following special values may be specified:

General return data
OUTPUT; CHAR(*)

General output information that applies to the OLJB0300 format. See General Return Data for a description of the data returned. This field is used only if the Length of general return data is greater than 8.

Length of general return data
INPUT; BINARY(4)

The length of the general output information. The general output information field must be a minimum of 8 bytes or 0 when the format is not OLJB0300. The default value for this field is 0.


Format of Receiver Variable

The following tables describe the order and format of the data that is returned in the receiver variable.

OLJB0100 Format



OLJB0200 Format



OLJB0300 Format



Field Descriptions

Active job status. The active status of the initial thread of the job. For the list of possible values, see the active job status field in the Work Management API Attribute Descriptions (WMAttrDesc).

Data. The data returned for the key field.

Internal job identifier. A value that is sent to other APIs to speed the process of locating the job on the system. Only APIs that are 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 follow:

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 workstation where the job started. For a batch job, you specify the name in the command when you submit the job.

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 follow:

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 follow:

Reserved. An ignored field.

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

Total length of data returned. The length of the data portion of the returned data. This includes the sum of all the keyed data for the job.

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.


Format of Receiver Variable Definition Information



Field Descriptions

Displacement to data. The displacement from the beginning of the job record to the value for this key.

Key field. The field returned. See List of Keys Supported for Format OLJB0200 for the list of valid keys supported for the OLJB0200 format. See List of Keys Supported for Format OLJB0300 for the list of valid keys supported for the OLJB0300 format.

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

Length of field information returned. The total length of definition 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 in each record that is returned to the application.

Reserved. An ignored field.

Type of data. The type of data that is returned. Note: For a key that is documented as returning a BINARY(8) UNSIGNED value, the QGYOLJOB API may return a 'C' rather than the expected 'B'. This is done for compatibility with older implementations.



Format of Sort Information



Field Descriptions

Number of keys to sort on. The number of fields within the record structure to sort on. If 0 is specified, the list is not sorted.

The following special value is supported for format OLJB0200 only. Also, the job selection information must be set to return only the jobs that are waiting to run from a single job queue.

The following special value is supported for format OLJB0300 only.

Reserved. Reserved field. This field must be set to hexadecimal or binary zero.

Sort key field data type. The data type of the field to sort on. Refer to the key data type field in the Sort (QLGSORT) API for information on the list of data types available.

Sort key field length. The length of the field to sort on.

Sort key field starting position. Within the record of information, the starting position of the field to sort on. A value of 1 represents the first position within the record.

Sort order. Whether the list should be sorted in ascending or descending order according to the key.



Format of Job Selection Information

The organization of the job selection information parameter is shown below. A description of the fields in the parameter follows the table.


OLJS0100 Format



OLJS0200 Format



Field Descriptions

Active job status. The active status of the initial threads of the jobs to be included in the list. For the list of possible values, see the active job status field in the Work Management API Attribute Descriptions (WMAttrDesc). (For compatibility with previous releases, the CLDW status can be specified in the active job status array. The CLDW status is not returned, however, for any jobs.)

Active subsystem. The active subsystem under which the job is currently running.

Current user profile. The user profile under which the initial thread of the job is currently running. This name may differ from the user portion of the job name. The current user profile is blank for jobs that are not active.

Job name. A specific job name, a generic name, or one of the following special values:

Job number. A specific job number or one of the following special values:

Job queue names. The job queue names. Jobs on these job queues are included in the list. The first 10 characters contain the job queue name, and the last 10 characters contain the library name.

Jobs on job queue status. The status of the jobs on the job queue to be included in the list. The possible values follow:

Job type. The type of job to be listed. The possible values follow:

Job type - enhanced. The type of job to be listed. This field combines the Job type and Job Subtype fields. The possible values are:

Memory pool. The identifier of the system memory pool in which the job started running. The identifier is a number in the range of 1 - 64.

Number of active job status entries. The number of entries that are specified for the active job status array. If this value is 0, no filtering is done on active job status. The offset to active job status array and the active job status array fields are not used. If the value is not 0, the primary job status array must include an array entry of *ACTIVE or the number of primary job status array entries should be specified as 0 to indicate that no filtering is done on the primary job status.

Number of active subsystem entries. The number of entries that are specified for the active subsystem array. If this value is 0, no filtering is done on active subsystems, and the offset to the active subsystem array and the active subsystem array fields are not used. This value must be 0 when format OLJB0100 or OLJB0200 is specified.

Number of current user profile entries. The number of entries that are specified for the current user profile array. If this value is 0, no filtering is done on the current user profile, and the offset to current user profile array and the current user profile array fields are not used.

Number of job queue names entries. The number of entries that is specified for the job queue names array. If this value is 0, no filtering is done on the job queue names. The offset to job queue names array and the job queue names array fields are not used. If this value is not 0, the primary job status array must include an array entry of *JOBQ or the number of primary job status array entries should be specified as 0 to indicate that no filtering is done on the primary job status. This value must be 0 when format OLJB0300 is specified.

Number of jobs on job queue status entries. The number of entries that are specified for the jobs on job queue status array. If this value is 0, no filtering is done on the jobs on job queue status array. The offset to jobs on job queue status array and the jobs on job queue status array fields are not used. If this value is not 0, the primary job status array must include an array entry of *JOBQ or the number of primary job status array entries should be specified as 0 to indicate that no filtering is done on the primary job status. This value must be 0 when format OLJB0300 is specified.

Number of job type - enhanced entries. The number of entries that are specified for the job type - enhanced array. If this value is 0, no filtering is done on the job type - enhanced array. The offset to job type - enhanced array and the job type - enhanced array fields are not used.

Number of memory pool entries. The number of entries that are specified for the memory pool name array. If this value is 0, no filtering is done on memory pool, and the offset to the memory pool name array and the memory pool name array fields are not used. This value must be 0 when format OLJB0100 or OLJB0200 is specified.

Number of primary job status entries. The number of entries that are specified for the primary job status array. If 0 is specified, no filtering is done on the primary job status, and the offset to primary job status array and the primary job status array fields are not used. This value must be 0 when format OLJB0300 is specified.

Number of qualified job name entries. The number of entries that are specified for the qualified job name array. If 0 is specified, no filtering is done on the qualified job name, and the offset to qualified job name array and the qualified job name array fields are not used. This value must be 0 when format OLJB0300 is specified. This value must be 0 when anything other than blanks are specified in the job name, user name, or job number fields. The same number of jobs will be returned in the list of returned jobs. For jobs that are not found, the Status, Job type, and Job subtype fields will be set to blanks and the Job information status field will be set to 'L'.

Number of server type entries. The number of entries that is specified for the server type array. If this value is 0, no filtering is done on the server type. Also, the offset to server type array and the server type array fields are not used.

Offset to active job status array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the active job status array.

Offset to active subsystem array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the active subsystem array.

Offset to current user profile array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the current user profile array.

Offset to job queue names array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the job queue names array.

Offset to jobs on job queue status array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the jobs on job queue status array.

Offset to job type - enhanced array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the job type - enhanced array.

Offset to memory pool array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the memory pool name array.

Offset to primary job status array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the primary job status array.

Offset to qualified job name array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the qualified job name array.

Offset to server type array. The offset in characters (bytes) from the beginning of the job selection information structure to the beginning of the server type array.

Primary job status. The primary status of the jobs to be included in the list. The possible special values follow:

Qualified job name. The qualfied job name. The first 10 characters are the job name. The second 10 characters are the user name of the job. The last 6 characters are the job number.

Reserved (ignored). An ignored field.

Reserved (must be 0). Reserved field. This field must be set to zero.

Server type. The type of server represented by the job. Servers provided by IBM start with QIBM. A server type, a generic value, or one of the following special values can be specified:

User name. A specific user profile name, a generic name, or one of the following special values:



General Return Data



Field Descriptions

Bytes available. The number of bytes of data available to be returned. All available data is returned if enough space is provided.

Bytes returned. The number of bytes of data returned.

Elapsed time. The time, in milliseconds, that has elapsed between the measurement start time and the current system time. This value is 0 the first time this API is called by this job. The measurement start is set the first time this API is called and when the Reset status statistics is set to reset the elapsed time.

Reserved. An ignored field.


List of Keys Supported for Format OLJB0200

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



List of Keys Supported for Format OLJB0300

The following table contains a list of the valid keys for format OLJB0300. 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.

When collecting performance statistics, it is important to provide an adequate time interval. The reported values reflect both the performance of the job that the API is looking at and the performance of the job that the API is running in. For example, you may see percentages greater than 100% because of the way the API interacts with the job that it is sampling.


Error Messages



API introduced: V4R1

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