CHKMSGID (Check Message Identifier) keyword for physical and logical files

You can use this field-level keyword to identify an error message that is associated with validity checking keywords.

If the CHKMSGID keyword is not specified, a system-supplied message is used. If the CHKMSGID keyword is specified and the field you are now defining is referred to later during display file creation, the validity checking information and the CHKMSGID keyword are copied into the display file. If a validity checking error is found while checking input from the screen, the error message specified on the CHKMSGID keyword is displayed on the message line.

CHKMSGID does not affect the physical or logical file you are defining.

The format of the keyword is:
CHKMSGID(message-id [library/]message-file [message-data-field])

If the message-data-field parameter is specified, the field it identifies does not need to be defined in the physical or logical file. However, if the field containing the CHKMSGID keyword is referred to during display file creation, the message data field must be defined in the display file (in the same record format as the field with the CHKMSGID keyword).

CHKMSGID is allowed only on fields that also contain a VALUES, RANGE, CMP, COMP, CHECK(M10), CHECK(M11), CHECK(VN), or CHECK(VNE) keyword.