Retrieve Server Job Information (QGYRTVSJ) API


  Required Parameter Group:

1 Receiver variable Output Char(*)
2 Length of receiver variable Input Binary(4)
3 Format name Input Char(8)
4 Error code I/O Char(*)

  Default Public Authority: *USE

  Threadsafe: No

The Retrieve Server Job Information (QGYRTVSJ) API returns information about auxiliary server jobs that were started for the current job. This API will return the number of auxiliary server jobs and the job names for each auxiliary server job. This information can be used to:

An auxiliary server job is used to do work asynchronously from the job that started the auxiliary server job. For example, the auxiliary server job is used to complete building lists of information.

The Change Server Job (QGYCHGSJ) API can be used to change the maximum number of auxiliary server jobs that can be active at any one time.


Authorities and Locks

None.


Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The receiver variable that receives the information requested. You can specify the size of the area to be smaller than the format requested as long as you specify the length parameter correctly. As a result, the API returns only the data that the area can hold.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable provided. The length of receiver variable parameter may be specified up to the size of the receiver variable specified in the user program. If the length of receiver variable parameter specified is larger than the allocated size of the receiver variable specified in the user program, the results are not predictable. The minimum length is 8 bytes.

Format name
INPUT; CHAR(8)

The format of the information to be returned. You can use this format:

SJBI0100 Basic auxiliary server job information. For details see SJBI0100 Format.

Error code
I/O; CHAR(*)

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


SJBI0100 Format

The following table describes the information returned in the receiver variable for the SJBI0100 format. For detailed descriptions of the fields, see Field Descriptions.

Offset Type Field
Dec Hex
0 0 BINARY(4) Bytes returned
4 4 BINARY(4) Bytes available
8 8 BINARY(4) Number of active auxiliary server jobs
12 C BINARY(4) Number of auxiliary server jobs allowed
16 10 BINARY(4) Offset to auxiliary server job information
20 14 BINARY(4) Job information record size
Offsets vary. These fields repeat for each active auxiliary server job. CHAR(26) Qualified auxiliary server job name
CHAR(16) Internal job identifier


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.

Internal job identifier. A value sent to other APIs to speed the process of locating the job on the system. Only IBM® i APIs 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 record size. The length of the auxiliary server job information record.

Number of active auxiliary server jobs. The number of auxiliary server jobs currently running for the current job.

Number of auxiliary server jobs allowed. The number of auxiliary server jobs allowed to be running at one time. The values are 1 through 5.

Offset to auxiliary server job information. The offset from the beginning of the receiver variable to the beginning of the auxiliary server job names.

Qualified auxiliary server job name. The qualified job name of the auxiliary server job. The qualified job name consists of the following fields:

CHAR(10) Job name
CHAR(10) User name
CHAR(6) Job number


Error Messages

Message ID Error Message Text
CPF24B4 E Severe error while addressing parameter list.
CPF3C19 E Error occurred with receiver variable specified.
CPF3C21 E Format name &1 is not valid.
CPF3C24 E Length of the receiver variable is 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: V3R6

[ Back to top | Process Open List APIs | APIs by category ]