CHKMSGID (Check Message Identifier) keyword for display files

Use this field-level keyword to identify an error message that is issued when a validity check error is detected.

If you do not specify the CHKMSGID keyword, the system supplies a message. You specify the associated validity checking rules on a CHECK(M10), CHECK(M11), CHECK(VN), CHECK(VNE), CMP, COMP, RANGE, or VALUES keyword.

The format of the keyword is:

CHKMSGID(message-id [library/]message-file [&message-data-field])

The message-ID parameter specifies the message description that contains the text to be displayed on the message line.

The message-file and library parameters identify the message file containing the message descriptions. The library name is optional. If it is not specified, the library list (*LIBL) that is in effect at run time is used to search for the message file.

The message-data-field parameter specifies the name of the field that contains the message replacement text to be displayed on the message line. The format of the message-data-field parameter is &field-name where field-name is the name of the field containing the message replacement text. The field name must exist in the record format, and the field must be defined as a character field (data type A) with usage P.

CHKMSGID is allowed only on fields which also contain a CHECK(M10), CHECK(M11), CHECK(VN), CHECK(VNE), CMP, COMP, RANGE, or VALUES keyword. The field must be input-capable (usage B or I).

Option indicators are not valid for this keyword.

Example

The following example shows how to specify the CHKMSGID keyword.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A                                      MSGLOC(20)
00020A          R RECORD1
00030A            FIELD1        10A  B  4  2CHECK(VN) CHKMSGID(USR1234 +
00040A                                      QGPL/USRMSGS &MSGFLD1);
00050A            MSGFLD1       12A  P
00060A            FIELD2         1A  I  4 20VALUES('A' 'B' 'I')
00070A                                      CHKMSGID(XYZ9999 APPLMSGS)
00080A            FIELD3         3S OB  4 25RANGE(023 199)
     A

When RECORD1 is read from the display screen:

Related reference
VALUES (Values) keyword for display files