Retrieve Job Queue Information (QSPRJOBQ) API


  Required Parameter Group:


  Default Public Authority: *USE

  Threadsafe: No

The Retrieve Job Queue Information (QSPRJOBQ) API retrieves information associated with a specified job queue.

The QSYS2.JOB_QUEUE_INFO view can be used as an alternative to this API. See JOB_QUEUE_INFO view for more information.


Authorities and Locks

Job Queue Library Authority
The caller needs *EXECUTE authority to the job queue library.

Job Queue Authority
The caller needs one of the following:

  • *READ authority to the job queue.
  • Job control special authority (*JOBCTL) if the job queue is operator controlled (OPRCTL(*YES)).
  • Spool control special authority (*SPLCTL).

Job Queue Lock
This API gets an *EXCLRD lock on the job queue.

Subsystem Description Lock
This API gets an *EXCLRD lock on the subsystem description.

This API does not check the caller's authority to the subsystem description or subsystem description library when retrieving the subsystem description information.


Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable that is to receive the information requested.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable provided by the receiver variable parameter. The amount of data returned is truncated if it is too small. A length of less than 8 is not valid.

Format name
INPUT; CHAR(8)

The content and format of the queue information being returned. The valid format names are:


Qualified job queue name
INPUT; CHAR(20)

The name of the job queue for which information is returned. The first 10 characters contain the queue name, and the second 10 characters contain the name of the library in which the queue resides.

The following special values are supported for the library name:


Error code
I/O; CHAR(*)

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


JOBQ0100 Format

The following table shows the information returned for the JOBQ0100 format. For more details about the fields in the following table, see Field Descriptions.



JOBQ0200 Format

The following table shows the information returned for the JOBQ0200 format. For more details about the fields in the following table, see Field Descriptions.



Field Descriptions

Active jobs with priority 0 through 9. The number of jobs that are active for each priority level (0 through 9). If the subsystem name and subsystem library name are blank, then this field is 0.

Authority to check. Whether the user must be the owner of the queue in order to control the queue by holding or releasing the queue. The possible values are:

Bytes available. Total format data length.

Bytes returned. Length of the data returned.

Current active. The current number of jobs that are active that came through this job queue entry.

Held jobs on queue with priority 0 through 9. The number of jobs currently sitting on the job queue in *HELD status for each priority level (0 through 9).

Job queue library name. The name of the library that contains the job queue.

Job queue name. The name of the job queue.

Job queue status. The status of the job queue. The status may be one of the following values:

Maximum active. The maximum number of jobs that can be active at the same time through this job queue entry. A -1 in this field indicates that the value is *NOMAX.

Maximum active jobs with priority 1 through 9. The maximum number of jobs that can be active at the same time for each priority level (1 through 9). A -1 in this field indicates that the value is *NOMAX. If the subsystem name and subsystem library name are blank, then this field is 0.

Number of jobs. The number of jobs in the queue.

Operator controlled. Whether a user who has job control authority is allowed to control this job queue and manage the jobs on the queue.

Released jobs on queue with priority 0 through 9. The number of jobs currently sitting on the job queue in *RELEASED status for each priority level (0 through 9).

Scheduled jobs on queue with priority 0 through 9. The number of jobs currently sitting on the job queue in *SCHEDULED status for each priority level (0 through 9).

Sequence number. The job queue entry sequence number. The subsystem uses this number to determine the order in which job queues are processed. Jobs from the queue with the lowest sequence number are processed first.

Subsystem name. The name of the subsystem that can receive jobs from this job queue. If there is no name, then this queue is not associated with an active subsystem, and no job can be processed.

Subsystem library name. The library in which the subsystem description resides. If there is no name, then this queue is not associated with with an active subsystem and no job can be processed.

Text description. Text that briefly describes the job queue.



Error Messages



API introduced: V2R2

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