CL Programming


Model for the Primary Job Log

The IBM supplied model for the primary job log file is QAMHJLPR in library QSYS. The primary record format is QMHPFT. A detailed description of this format follows:

Field Order Field Name Data Type Length in Bytes Field Description
1 QMHJDT DATE 10 Date job log created
2 QMHJTM TIME 8 Time job log created
3 QMHMRK CHAR 4 Message reference key
4 QMHTYP CHAR 10 Message type
5 QMHSEV BIN 4 Message severity
6 QMHMID CHAR 7 Message ID
7 QMHDAT DATE 10 Message sent date
8 QMHTIM TIME 8 Message sent time
9 QMHMF CHAR 20 Message file name
10 QMHRPY CHAR 4 Reply reference key
11 QMHRQS CHAR 1 Request Message Status
12 QMHSTY CHAR 1 Sending program type
13 QMHRTY CHAR 1 Receiving program type
14 QMHSSN BIN 4 Number of statements for sending program
15 QMHRSN BIN 4 Number of statements for receiving program
16 QMHCID BIN 4 CCSID of the message data or immediate message
17 QMHPRL CHAR 1 Message percolated indicator
18 QMHSPR VAR CHAR 256 MAX Sending procedure name
19 QMHSMD CHAR 10 Sending module name
20 QMHSPG CHAR 12 Sending program name
21 QMHSLB CHAR 10 Sending library name
22 QMHSTM CHAR 30 Statement number(s) for sending program
23 QMHRPR VAR CHAR 256 MAX Receiving procedure name
24 QMHRMD CHAR 10 Receiving module name
25 QMHRPG CHAR 10 Receiving program name
26 QMHRLB CHAR 10 Receiving program library name
27 QMHRTM CHAR 30 Statement number(s) for receiving program
28 QMHSYS CHAR 8 System name
29 QMHJOB CHAR 26 Qualified Job name
30 QMHMDT VAR CHAR 3000 MAX Message data or immediate message
31 QMHCSP VAR CHAR 4096 MAX Complete sending procedure name
32 QMHCRP VAR CHAR 4096 MAX Complete receiving procedure name
33 QMHLSP VAR CHAR 6144 MAX Long sending program name
34 QMHTID CHAR 8 Thread
35 QMHMSC ZONED 6,0 Microseconds

The definition of the fields in this record are as follows:

QMHJDT
Date job log created; DATE(10)

The date the production of the job log began. The field is a date field in the database record. The format of the date is *ISO. A value in this date field is in the format yyyy-mm-dd. Each record produced for the same job log will have the same value in this field.

QMHJTM
Time job log create; TIME(8)

The time the production of the job log began. This field is defined as a time field in the database record. The format of the time is defined to be *ISO. A value in this time field is in the format hh.mm.ss. Each record produced for the same job log will have the same value in this field.

QMHMRK
Message reference key; CHAR(4)

The message reference key the related message had in the job message queue. The records are placed in the primary database file in strictly ascending sequence by message reference key. Within the set of records produced for a single job log, this field is unique for each record and thus can be used as a unique key for the record. If the records for two or more job logs are placed into the same member, the key may no longer be unique.

QMHTYP
Message type; CHAR(10)

The message type of the related message. One of the following special values will appear in this field:

*CMD
Commands that are logged from the execution of a CL program.

*COMP
Completion message type.

*COPY
Sender's copy message type.

*DIAG
Diagnostic message type.

*ESCAPE
Escape message type.

*INFO
Information message type.

*INQ
Inquiry message type.

*NOTIFY
Notify message type.

*RQS
Request message type.

*RPY
Reply message type.
QMHSEV
Message severity; BIN(4)

The severity the message has. This is a value from 0 through 99.

QMHMID
Message ID; CHAR(7)

The message ID for the message. This field will contain the special value *IMMED if the message is an immediate message which has no message ID.

QMHDAT
Message sent date; DATE(10)

The date the message was sent. This field is defined as a date field in the database record. The format of the date is *ISO. A value in this field is in the format yyyy-mm-dd.

QMHTIM
Message sent time; TIME(8)

The time the message was sent. The field is defined as a time field in the database record. The format of the time is defined to be *ISO. A value in this field is in the format hh.mm.ss.

QMHMF
Message File; CHAR(20)

The name of the message file that is to be used to obtain the message description for the message. The first 10 characters of the field contain the message file name. The second 10 characters contain the library name. If the field QMHMID contains *IMMED to indicate an immediate message, this field will contain all blanks.

QMHRPY
Reply reference key; CHAR(4)

In order to maintain the strictly ascending sequence by message reference key, the record for the reply message may not immediately follow the record for the inquiry, notify, or sender's copy message.

QMHRQS
Request Message Status; CHAR(1)

If the messages type is not *RQS, this indicator will always be zero.

QMHSTY
Sending program type; CHAR(1)

An indicator with the following values that shows whether the sending program was an OPM program or an ILE program.

QMHRTY
Receiving program type; CHAR(1)

An indicator with the following values that shows the type of the receiving program:

QMHSSN
Number of statements for sending program; BIN(4)

The number of statement numbers for sending program.

The value provided in this field defines how many statement numbers are in the field QMHSTM.

QMHRSN
Number of statements for receiving program; BIN(4)

The number of statement numbers for receiving program.

QMHCID
CCSID of message data; BIN(4)

The CCSID of the message data or immediate message that is contained in the field QMHMDT.

QMHPRL
Message percolate indicator; CHAR(1)

An indicator that shows whether the message was percolated to the receiving program or not.

Message percolation can only occur within an ILE program. Therefore, this field contains a one only if the receiving program type field QMHRTY contains a one ('F1'X) or a two ('F2'X).

QMHSPR
Sending procedure name; VAR CHAR(*)

This field can contain a nested procedure name for a sending program type of one ('F1'X) or two ('F2'X); each procedure name is separated by a colon. The outer-most procedure name is identified first and is followed by the procedures contained in it. The inner-most procedures are identified last in the string.

QMHSMD
Sending module name; CHAR(10)
QMHSPG
Sending program name; CHAR(12)
QMHSLB
Sending library name; CHAR(10)

The name of the library that the sending program was contained in.

QMHSTM
Statement number(s) for sending program; CHAR(30)

The statement number(s) at which the sending program sent the message. Each statement number is 10 characters in length.

QMHRPR
Receiving procedure name; VAR CHAR(*)

This field can contain a nested procedure name for a sending program type of 1 or 2; each procedure name is separated by a colon. The outer-most procedure name is identified first and is followed by the procedures contained in it. The inner-most procedures are identified last in the string.

QMHRMD
Receiving module name; CHAR(10)
QMHRPG
Receiving program name; CHAR(10)

The program name of the OPM or ILE program to which the message was sent.

QMHRLB
Receiving library name; CHAR(10)

The name of the library that the receiving program was in.

QMHRTM
Statement number(s) for receiving program; CHAR(30)

The statement number(s) at which the receiving program was stopped when the message was sent. Each statement number is 10 characters in length.

For any other value of the receiving program type, there can be 0, 1, 2, or 3 statement numbers in this field. The field QMHRSN specifies how many there are. In this case, a statement number is a higher level language statement number and not an MI instruction number. Each number is a decimal number.

QMHSYS
System name; CHAR(8)

The name of the system that the job log was produced on.

QMHJOB
Qualified job Name; CHAR(26)

The fully qualified name of the job for which the message is being logged for. The first 10 positions contain the job name, the next 10 positions the user name, and the last six positions the job number.

QMHMDT
Message data; VAR CHAR(*)

If the field QMHMID contains the special value *IMMED, this field contains an immediate message. Otherwise, this field contains the message data that was used when the message was sent. This field can contain a maximum of 3000 characters. If the immediate message or message data is longer, it is truncated to 3000 characters.

If the message data contains pointers, the pointers is invalidated before the message data is written to the database file.

QMHCSP
Complete sending procedure name; CHAR(VAR)
QMHCRP
Complete receiving procedure name; CHAR(VAR)
QMHLSP
Long sending program name; CHAR(VAR)

This field contains the entire sending program name from which the message was sent for all sending program types. The name can be a maximum of 6144 characters in length.

QMHTID
Thread; CHAR(8)

This field identifies the thread within the job that sent the message.

QMHMSC
Microseconds; ZONED(6,0)

This is the microseconds part of the time the message was sent. It can be used to determine with more precision the time the message was sent.

The IBM supplied model for the secondary job log file is QAMHJLSC in library QSYS. The secondary record format name is QMHSFT. A detailed description of the secondary record format follows:

Field Order Field Name Data Type Length in Bytes Field Description
1 QMHJDS DATE 10 Date job log created
2 QMHJTS TIME 8 Time job log created
3 QMHMKS CHAR 4 Message reference key
7 QMHSYN CHAR 8 System name
8 QMHJBN CHAR 26 Qualified job name
4 QMHLNN BIN 4 Message line number
5 QMHSID BIN 4 CCSID of text line
6 QMHTTY CHAR 1 Message text indicator
9 QMHLIN CHAR 78 Message text line

The length of the field indicates the number of total bytes for the field.

The definition of the fields in this record are as follows:

QMHJDS
Date job log created; DATE(8)

The date the production of the job log began. The field is a date field in the database record. The format of the date is *ISO. A value in this field is in the format yyyy-mm-dd. Each record produced for the same job log will have the same value in this field.

QMHJTS
Time job log created; TIME(8);

The time the production of the job log began. This field is defined as a time field in the database record. The format of the time is defined to be *ISO. A value in this field is in the format hh.mm.ss. Each record produced for the same job log will have the same value in this field.

QMHMKS
Message reference key; CHAR(4)

The message reference key the related message had in the job message queue. The records are placed in the secondary database file in ascending sequence by message reference key. There can be more than one secondary record for a specific message reference key. This field also exists in the related primary record. Therefore, once the message reference key is obtained from a primary record, it can be used to read the related records from the secondary file.

QMHSYN
System name; CHAR(8)

The name of the system that the job log was produced on.

QMHJBN
Qualified job Name; CHAR(26)

The fully qualified name of the job for which the message is being logged for. The first 10 positions contain the job name, the next 10 positions the user name, and the last six positions the job number.

QMHLNN
Message line number; BIN(4)

The line number of the line within the text type. For both the first and second level text, the line number starts at one for the first line of the text and is incremented by one for each additional line within that level.

QMHSID
CCSID of message text line; BIN(4)

The CCSID of the message text line that is contained in field QMHLIN.

QMHTTY
Message text type; CHAR(1)

An indicator which specifies whether field QMHLIN contains a line of the first or second level text. This field will contain one of the following values:

1
Field QMHLIN contains first level text.

2
Field QMHLIN contains second level text.
QMHLIN
Message text line: CHAR(78)

This field contains one line of the first or second level text.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]