Creating a message source file
z/OS UNIX provides commands and subroutines to
retrieve and display program messages located in externalized message catalogs. The
gencat command is used to convert a message source file containing application
messages into a message catalog. The mkcatdefs command can be used to preprocess
a message source file into a format that can be passed to the gencat command.
mkcatdefs processing is only needed if you wish to use symbolic names for
messages. To create a message-text source file, open a file using any text editor. Enter a message
identification number or symbolic identifier. Then enter the message text as shown below:
1 message-text
2 message-text
OUTMSG message-text
4 message-text The following usage rules apply:
- There must be one blank character between the message ID number or identifier and the message text.
- A symbolic identifier must begin with an alphabetic character and can contain only alphanumeric characters (letters of the alphabet, decimal digits, and underscores).
- The first character of a symbolic identifier cannot be a digit.
- The maximum length of a symbolic identifier is 255 bytes.
- Message ID numbers must be assigned in ascending order within a single message set, but need not be contiguous. 0 (zero) is not a valid message ID number. Message IDs in a gencat input file can be in the range 1 - NL_MSGMAX.
- Message ID numbers must be assigned as if intervening symbolic identifiers are also numbered. If the lines in the previous example had been numbered 1, 2, OUTMSG, and 3, this would be an error. This is because the mkcatdefs command also assigns numbers to symbolic identifiers and would have assigned 3 to the OUTMSG symbolic identifier.