Open List of Job Log Messages (QGYOLJBL) API


  Required Parameter Group:

1 Receiver variable Output Char(*)
2 Length of receiver variable Input Binary(4)
3 List Information Output Char(80)
4 Number of records to return Input Binary(4)
5 Message selection information Input Char(*)
6 Size of message selection information Input Binary(4)
7 Error code I/O CHAR(*)

  Default Public Authority: *USE

  Threadsafe: No

The Open List of Job Log Messages (QGYOLJBL) API lists messages from a job log. The returned messages are sorted by their sending date and time unless the message being listed is a reply message to an inquiry, a sender's copy, or a notify type message. When a reply message exists for one of these messages, the reply message is not positioned according to the sending date and time of the reply. The reply message is, instead, listed immediately following the inquiry, the sender's copy, or the notify message that it is associated with.

Note: The QTEMP library and the system portion of the library list could be different between the main job and the server job when the list is being built asynchronously. If this is a problem, request that the list be built synchronously.

For more information, see Process Open List APIs.


Differences between QMHLJOBL and QGYOLJBL

The differences between the QGYOLJBL API and the List Job Log Messages (QMHLJOBL) API follow:


Authorities and Locks

User Space Lock
*EXCLRD
Job Authority

For additional information on job authorities, see Planning and setting up system security.


Required Parameter Group

Receiver variable
OUTPUT; CHAR(*)

The variable used to return the requested number of records containing message information. See OLJL0100 Format for a description of this parameter.

Length of receiver variable
INPUT; BINARY(4)

The length of the receiver variable.

List information
OUTPUT; CHAR(80)

The variable used to return status information about the list of job log messages that was opened. For a description of this parameter, see Open list information format.

Number of records to return
INPUT; BINARY(4)

The number of records in the list to be put into the receiver variable. Valid values for this field are:

-1 All records are built synchronously in the list by the main job.
0 All records are built asynchronously in the list by a server job.

If a positive number of records is specified, at least that many records are built synchronously (in order to return those records immediately to the caller of this API), and the remainder are built asynchronously by a server job.

Message selection information
INPUT; CHAR(*)

The information that determines the job message queue and messages to be listed. The format of this information is described in Message Selection Information Format.

Size of message selection information
INPUT; BINARY(4)

The size, in bytes, of the message selection information parameter. The minimum value of this parameter is 85.

Error code
I/O; CHAR(*)

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


OLJL0100 Format

For detailed descriptions of each field, see the Field Descriptions.

Offset Type Field
Dec Hex
0 0 BINARY(4) Offset to the next entry
4 4 BINARY(4) Offset to fields returned
8 8 BINARY(4) Number of fields returned
12 C BINARY(4) Message severity
16 10 CHAR(7) Message identifier
23 17 CHAR(2) Message type
25 19 CHAR(4) Message key
29 1D CHAR(10) Message file name
39 27 CHAR(10) Message file library specified at send time
49 31 CHAR(7) Date sent
56 38 CHAR(6) Time sent
62 3E CHAR(6) Microseconds
68 44 CHAR(8) Thread ID
76 4C CHAR(*) Reserved
These fields repeat for each identifier field specified. BINARY(4) Offset to the next field information returned
BINARY(4) Length of field information returned
BINARY(4) Identifier field
CHAR(1) Type of data
CHAR(1) Status of data
CHAR(14) Reserved
BINARY(4) Length of data
CHAR(*) Data
CHAR(*) Reserved


Field Descriptions

Data. The data returned for the specified identifier field.

Date sent. The date on which the message was sent, in CYYMMDD (century, year, month, and day) format.

Identifier field. The field ID actually returned in the OLJL0100 format. See Valid Field Identifiers for the list of valid field identifiers.

Length of data. The length of the data returned for the data field, in bytes.

Length of field information returned. The total length of information returned for this field, in bytes.

Message file library specified at send time. The name of the library containing the message file as specified when the message was sent. If *CURLIB or *LIBL were specified for the library when the message was sent, that value is returned as the library here. For the actual library used when the message is sent, see the message file library used field identifier.

Message file name. The name of the message file containing the message listed.

Message identifier. The identifying code of the message listed. If an impromptu message is listed, this field is set to blanks.

Message key. The message reference key of the message listed.

Message severity. The severity of the message listed. Possible values are 0 through 99.

Message type. The type of message listed. The possible values and their meanings follow:

Value Message Type
01 Completion
02 Diagnostic
04 Informational
05 Inquiry
06 Sender's copy
08 Request
10 Request with prompting
14 Notify, exception already handled when API is called
15 Escape, exception already handled when API is called
16 Notify, exception not handled when API is called
17 Escape, exception not handled when API is called
21 Reply, not checked for validity
22 Reply, checked for validity
23 Reply, message default used
24 Reply, system default used
25 Reply, from system reply list
26 Reply, from exit program

Microseconds. The microseconds part of the time sent.

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

Offset to fields returned. The offset, in bytes, from the beginning of the receiver variable to the beginning of the first repeating identified field of the OLJL0100 format.

Offset to the next entry. The offset, in bytes, from the beginning of the receiver variable to the beginning of the next message entry.

Offset to the next field information returned. The offset, in bytes, from the beginning of the receiver variable to the beginning of the next repeating identified field of the OLJL0100 format.

Reserved. An ignored field.

Status of data. The status of the data listed for this message. Possible values and their meanings follow:

blank The data returned is complete.
A The caller of the API was not authorized to view the data. This occurs when the caller of the API is not authorized to the message file or the message file library containing a stored message being listed.
D The data was damaged. This occurs when the message file or library specified at send time for a stored message is damaged when the API is called.
U The data was unavailable. This occurs when the message file or library specified at send time for a stored message is exclusively used by another process when the API is called.
N The data was not found. This occurs when the message file or library specified at send time for a stored message cannot be found or resolved when the API is called.

This field is applicable to the field identifiers that are retrieved from the message file for a stored message. A description of the action that occurs for specific field identifiers when the status of data field is not blank follows:

0101 When the status of data field is not blank, the alert option field identifier contains blanks.
0301, 0302 When the status of data field is not blank, these message field identifiers contain message text regarding the problem encountered while attempting to access the message file. Both fields have the replacement data substituted.
0401, 0402, 0403, 0404 When the status of data field is not blank, these message help field identifiers contain message text regarding the problem encountered while attempting to access the message file. All fields have the replacement data substituted. The message help with formatting characters and message help with replacement data and formatting characters field identifiers also have the message formatting characters included.
0501 When the status of data field is not blank, the default reply field identifier contains the system default reply.
0801 When the status of data field is not blank, the message file library used field identifier contains blanks.

This field is also applicable to the various sending and receiving information fields when a problem is encountered while attempting to retrieve this information. This includes field identifiers 0602, 0603, 0604, 0605, 0606, 0702, 0703, 0704, 0705, and 0706. When one of these fields cannot be retrieved from the message, the status of data field is set to U and the field is set to blanks.

The status of data field is always blank for the other field identifiers.

Thread ID. The 8-byte thread ID of the thread in which this message was sent.

Time sent. The time at which the message being listed was sent, in HHMMSS (hour, minute, and second) format.

Type of data. The type of data returned.

C The data is returned in character format.
B The data is returned in binary format.
M The data is returned in a mixed format. This value is returned for the field IDs 0606 and 0706, which contain a binary(4) value followed by an array of 10-character elements.


Message Selection Information Format

For detailed descriptions of each field, see the Field Descriptions.

Offset Type Field
Dec Hex
0 0 CHAR(10) List direction
10 A CHAR(26) Qualified job name
36 24 CHAR(16) Internal job identifier
52 34 CHAR(4) Starting message key
56 38 BINARY(4) Maximum message length
60 3C BINARY(4) Maximum message help length
64 40 BINARY(4) Offset of identifiers of fields to return
68 44 BINARY(4) Number of fields to return
72 48 BINARY(4) Offset to call message queue name
76 4C BINARY(4) Size of call message queue name
The offsets to these fields are specified in the previous offset variables. ARRAY(*) of BINARY(4) Identifiers of fields to return
CHAR(*) Call message queue name


Field Descriptions

Call message queue name. The name of the call message queue from which to list messages. You must use these values:

* Messages from every call of the job are listed.
*EXT Only messages sent to *EXT of the job are listed.

Identifiers of fields to return. The list of the identifiers of fields to be returned. For a list of the valid field identifiers, see Valid Field Identifiers.

Internal job identifier. The internal name for the job. The List Job (QUSLJOB) API creates this identifier. If you do not specify *INT for the job name parameter, this parameter must contain blanks. With this parameter, the system can locate the job more quickly than with a job name.

List direction. The direction to list messages. You must use one of the following directions:

*NEXT Return messages that are newer than the message specified by the starting message key parameter and the starting offset parameter. This returns messages that start with the oldest first, and the most recently sent message last.
*PRV Return messages that are older than the messages specified by the starting message key parameter. This returns messages that start with the most recently sent message first, and the oldest message last.

Maximum message help length. The maximum length of data to be returned for field identifiers 0401, 0402, 0403, and 0404.

Maximum message length. The maximum length of data to be returned for field identifiers 0301 and 0302.

Number of fields to return. The number of fields to return (the number of entries in the identifiers of fields to return array).

To avoid heavy utilization of system resources, users of this API must be cautious of selecting too many fields to return for the messages that are listed.

Offset to call message queue name. The offset, in bytes, from the beginning of the message selection information parameter to the beginning of the call message queue name field.

Offset of identifiers of fields to return. The offset, in bytes, from the beginning of the message selection information parameter to the beginning of the identifiers of fields to return array.

Qualified job name. The name of the job whose messages are to be listed. The qualified job name has three parts:

Job name CHAR(10)A specific job name or one of the following special values:
* The job that this program is running in. The rest of the qualified job name parameter must be blank.
*INT The internal job identifier locates the job. The rest of the qualified job name parameter must be blank.
User name CHAR(10) A specific user profile name, or blanks when the job name is the special value of * or *INT.
Job number CHAR(6) A specific job number, or blanks when the job name is the special value of * or *INT.

Size of call message queue name. The length of the call message queue name parameter, in bytes. The maximum length that can be specified is 256; the minimum length is 1.

Starting message key. The message key to be used to begin searching for messages to list from the job. You can use these special values for the message key:

'00000000'X The first message to be returned is the oldest message in the queue.
'FFFFFFFF'X The first message to be returned is the newest message in the queue.

If the specified key does not exist, messages are listed with the next key that does exist in the search direction specified by the list direction parameter.

If a key of a reply message is specified, the message search begins with the inquiry or notify message that the reply is associated with, not the reply message itself.

If the message specified by the starting message key exists but does not meet the selection criteria parameter and the severity criteria parameter specified, no error is returned. The search for messages to list begins from the point that is specified by the starting message key.


Valid Field Identifiers

For a detailed description of each field, see Field Descriptions.

Identifier Type Description
0101 CHAR(9) Alert option
0201 CHAR(*) Replacement data or impromptu message text
0301 CHAR(*) Message
0302 CHAR(*) Message with replacement data
0401 CHAR(*) Message help
0402 CHAR(*) Message help with replacement data
0403 CHAR(*) Message help with formatting characters
0404 CHAR(*) Message help with replacement data and formatting characters
0501 CHAR(*) Default reply
0601 CHAR(26) Qualified sender job name
0602 CHAR(1) Sender type
0603 CHAR(*) Sending program name
0604 CHAR(10) Sending module name
0605 CHAR(*) Sending procedure name
0606 BINARY(4) followed by ARRAY(*) of CHAR(10) Number of sending statement numbers or instruction numbers available followed by an array of the sending statement numbers or instruction numbers
0607 CHAR(10) Sending user profile
0702 CHAR(1) Receiving type
0703 CHAR(10) Receiving program name
0704 CHAR(10) Receiving module name
0705 CHAR(*) Receiving procedure name
0706 BINARY(4) followed by ARRAY(*) of CHAR(10) Number of receiving statement numbers or instruction numbers available followed by an array of the receiving statement numbers or instruction numbers
0801 CHAR(10) Message file library used
0901 CHAR(30) Problem identification
1001 CHAR(1) Reply status
1101 CHAR(1) Request status
1201 BINARY(4) Request level
1301 BINARY(4) Coded character set identifier (CCSID) for text
1302 BINARY(4) CCSID conversion status indicator for text
1303 BINARY(4) Coded character set identifier (CCSID) for data
1304 BINARY(4) CCSID conversion status indicator for data


Field Descriptions

Alert option. Whether and when an SNA alert is created and sent for the message. The value is one of the following:

*DEFER An alert is sent after local problem analysis.
*IMMED An alert is sent immediately when the message is sent to a message queue that has the allow alerts attribute set to *YES.
*NO No alert is sent.
*UNATTEND An alert is sent immediately when the system is running in unattended mode (when the value of the alert status network attribute, ALRSTS, is *UNATTEND).

For more information about alerts, see the Alerts Support Link to PDF manual.

This field is set to blanks if no alert option was specified when the message was sent.

CCSID conversion status indicator for data. The following values may be returned:

0 No conversion was needed because the CCSID of the data matched the CCSID that you wanted the data converted to.
1 No conversion occurred because either the data was 65535, or the CCSID you wanted the data converted to was 65535.
2 No conversion occurred because you did not ask for any message data to be returned or the data did not contain any *CCHAR type data.
3 The data was converted to the CCSID specified using the best fit conversion tables.
4 A conversion error occurred using the best fit conversion tables so a default conversion was attempted. This completed without error.
-1 An error occurred on both the best fit and default conversions. The data was not converted.

CCSID conversion status indicator for text. The following values may be returned:

0 No conversion was needed because the CCSID of the text matched the CCSID you wanted the text converted to.
1 No conversion occurred because either the text was 65535 or the CCSID you wanted the text converted to was 65535.
2 No conversion occurred because you did not ask for any text to be returned.
3 The text was converted to the CCSID specified using the best fit conversion tables.
4 A conversion error occurred using the best fit conversion tables so a default conversion was attempted. This completed without error.
-1 An error occurred on both the best fit and default conversions. The data was not converted.

Coded character set identifier (CCSID) for data. The coded character set identifier that the replacement data is returned in. This only applies to the part of the replacement data that corresponds to a convertible character data type (*CCHAR). All other replacement data will not be converted before it is returned and can be considered to have a CCSID of 65535. If a conversion error occurs or if the CCSID you requested the data to be converted to is 65535, the CCSID of the data is returned. If there is no *CCHAR replacement data, 65535 is returned. Otherwise the CCSID you wanted the data converted to is returned.

For more information about message handler and its use of CCSIDs, see CCSID support for messages. For more information about the *CCHAR field type, see the Add Message Description (ADDMSGD) command.

Coded character set identifier (CCSID) for text. The coded character set identifier that the message text is returned in. If a conversion error occurs or if the CCSID you requested the message text to be converted to is 65535, the CCSID that the message text is stored in is returned. Otherwise, the CCSID you wanted your message text converted to is returned. If you do not want the text converted before it is returned to you but you do want to know the CCSID that the message text is stored in, specify 65535 on the coded character set identifier to return text and data in parameter. The CCSID that the message text is stored in is returned in the coded character set identifier for text field.

This applies to the following fields only :

Note: This CCSID value does not apply to the replacement data that has been substituted into the text. See the coded character set identifier for data for this information.

Default reply. The text of the default reply when a stored message is being listed, and a default reply exists. If this is not an inquiry message, or no default reply exists, this field is not used, and the length of data field is 0.

Message. The text of a predefined message without replacement data substitution. If an impromptu message is listed, this field contains the impromptu message text.

Message file library used. The actual name of the library that contains the message file that is used to retrieve the message information. If an immediate message is listed, this field is set to blanks.

Message help. The message help for the message listed without formatting characters and without replacement of data. If an impromptu message is listed, this field contains the impromptu message text.

Message help with formatting characters. The message help for the message listed, including formatting characters.

Three format control characters can be returned within the message. They are defined in the online help for the Add Message Description (ADDMSGD) command to have these meanings:

&N Forces the text to a new line (column 2). If the text is longer than one line, the next lines are indented to column 4 until the end of text or another format control character is found.
&P Forces the text to a new line indented to column 6. If the text is longer than one line, the next lines start in column 4 until the end of text or another format control character is found.
&B Forces the text to a new line, starting in column 4. If the text is longer than one line, the next lines are indented to column 6 until the end of text or another format control character is found.

If an impromptu message is listed, this field contains the immediate message text.

Message help with replacement data. The message help for the message listed, including the replacement data. If an impromptu message is listed, this field contains the impromptu message text.

Message help with replacement data and formatting characters. The message help for the message listed, including the replacement data and the formatting characters. See the description of the message help with formatting characters field for an explanation of formatting characters. If an impromptu message is listed, this field contains the impromptu message text.

Message with replacement data. The text of a predefined message with the replacement data included. If an impromptu message is listed, this field contains the impromptu message text.

Number of the receiving statement numbers or instruction numbers available followed by an array of the receiving statement numbers. The number of statement numbers or instruction numbers available for the receiving program or procedure.

For original program model (OPM) programs and nonoptimized procedures, this count is 1.

For optimized procedures, this count can be greater than 1. In this case, each statement number represents a potential point at which the message could have been received. If the mapping table information has been removed from the program, this field returns a count of 0 and no statement numbers are available. The array of receiving statement numbers or instruction numbers immediately follows this field in the returned data.

Number of sending statement numbers or instruction numbers available followed by an array of the sending statement numbers or instruction numbers. The number of statement numbers or instruction numbers available for the sending program or procedure.

For OPM programs and nonoptimized procedures, this count is 1.

For optimized procedures, this count can be greater than 1. In this case, each statement number represents a potential point at which the message could have been sent. If the mapping table information has been removed from the program, this field returns a count of 0, and no statement numbers are available. The array of sending statement numbers or instruction numbers immediately follows this field in the returned data.

Problem identification. This field can be specified for the QGYOLJBL API, but it never returns any data and the length of data field is 0.

Qualified sender job name. This field can be specified for the QGYOLJBL API, but it never returns any data and the length of data field is 0.

Receiving module name. The name of the module that contains the procedure where the message was sent. If the message was not sent to a procedure within an Integrated Language Environment® (ILE) program, this field is not set and the length of data field is 0.

Receiving procedure name. The name of the procedure receiving the message. If the message was not sent to a procedure within an ILE program, this field is not set and the length of data field is 0. A nested procedure name has each procedure name separated by a colon. The outermost procedure name is identified first followed by the procedures it contains. The innermost procedure is identified last in the string.

Receiving program name. The program name, or the ILE program name that contains the procedure that the message was sent to.

Receiving type. The type of the receiver (whether it is a program or a procedure). Possible values and their meanings follow:

0 Receiver is an original program model (OPM) program
1 Receiver is a procedure within an ILE program and the procedure name is up to and including 256 characters in length
2 Receiver is a procedure within an ILE program and the procedure name is 257 or more characters in length

Replacement data or impromptu message text. The values for replacement variables in a predefined message, or the text of an impromptu message. If the message identifier field is not blank, this field contains message data. If the message identifier field is blank, this field contains impromptu message text.

Any pointer data in this field is marked as not valid if both of the following are true:

Reply status. The reply status of the message (whether it accepts a reply, and if so, whether a reply has been sent). Possible values and their meanings follow:

A Message accepts a reply, and a reply has been sent.
W Message accepts a reply, and a reply has not been sent. (The message is waiting for a reply.)
N Message does not accept a reply.

Request level. The level of the request-processing program that received the request message. If the message being listed is not a request, this field is set to 0.

Request status. Information regarding the processing status of the request message. Possible values and their meanings follow:

O This request message has been received and processed.
C This request message is currently being processed.
N This request message has not yet been processed.

If the message being listed is not a request, this field is set to a blank character.

Sender type. The type of the sender (whether it is a program or procedure). Possible values and their meanings follow:

0 Sender is an OPM or a System Licensed Internal Code (SLIC) program with a name that is 12 characters or less.
1 Sender is a procedure within an ILE program and the procedure name is up to and including 256 characters in length.
2 Sender is a procedure within an ILE program and the procedure name is from 257 characters up to and including 4096 characters in length.
3 Sender is a SLIC program with a name that is from 13 characters up to and including 256 characters in length.

Sending module name. The name of the module that contains the procedure sending the message. If the message was not sent by a procedure within an ILE program, this field is not set and the length of data field is 0.

Sending procedure name. The name of the procedure sending the message. If the message was not sent by a procedure within an ILE program, this field is not set and the length of data field is 0. A nested procedure name has each procedure name separated by a colon. The outermost procedure name is identified first followed by the procedures it contains. The innermost procedure is identified last in the string.

Sending program name. The sending program name or ILE program name that contains the procedure sending the message.

Sending user profile. The name of the user profile that the thread was running under when the message was sent.


Error Messages

Message ID Error Message Text
CPF1866 E Value &1 for number of fields to return not valid.
CPF24B4 E Severe error while addressing parameter list.
CPF24B7 E Value &1 for call stack entry name length not valid.
CPF240D E Message search direction specified is not valid.
CPF240F E Field identifier is not valid or is a duplicate of another field identifier specified.
CPF2401 E Not authorized to library &1.
CPF2410 E Message key not found in message queue &1.
CPF241E E Call stack entry name is not valid.
CPF241F E Length &1 specified for maximum message length is not valid.
CPF2441 E Not authorized to display job log.
CPF2443 E Job log not displayed or listed because job has ended.
CPF252F E Length &1 specified for maximum message help length is not valid.
CPF3CF1 E Error code parameter not valid.
CPF3C19 E Error occurred with receiver variable specified.
CPF3C21 E Format name &1 is not valid.
CPF3C31 E Object type &1 is not valid.
CPF3C51 E Internal job identifier not valid.
CPF3C52 E Internal job identifier no longer valid.
CPF3C53 E Job &3/&2/&1 not found.
CPF3C55 E Job &3/&2/&1 does not exist.
CPF3C58 E Job name specified is not valid.
CPF3C59 E Internal identifier is not blanks and job name is not *INT.
CPF3C90 E Literal value cannot be changed.
CPF6565 E User profile storage limit exceeded.
CPF8100 E All CPF81xx messages could be returned. xx is from 01 to FF.
CPF9801 E Object &2 in library &3 not found.
CPF9802 E Not authorized to object &2 in &3.
CPF9803 E Cannot allocate object &2 in library &3.
CPF9807 E One or more libraries in library list deleted.
CPF9808 E Cannot allocate one or more libraries on library list.
CPF9811 E Program &1 in library &2 not found.
CPF9812 E File &1 in library &2 not found.
CPF9814 E Device &1 not found.
CPF9821 E Not authorized to program &1 in library &2.
CPF9822 E Not authorized to file &1 in library &2.
CPF9825 E Not authorized to device &1.
CPF9831 E Cannot assign device &1.
CPF9838 E User profile storage limit exceeded.
GUI0002 E &2 is not valid for length of receiver variable.
GUI0027 E &1 is not valid for number of records to return.
GUI0044 E &1 is not valid for length of message selection information.


API introduced: V3R6

[ Back to top | Message Handling APIs | APIs by category ]