Defining Messages
The Message Definition utility (msgmnt) lets you define messages used to process errors and information in online and batch programs. You can define a message for a specific product line and program, or you can define a message that is global to the product line (independent of the program).
To define a message
The following example of message text (typed in the Message field) produces a message that inserts the employee number, employee name, company number, and company name.
Employee {0} {1} works at {2} [3} company.
To implement this message, EM101PD must contain the following lines of code:
MOVE "EM101" TO CRT-ERROR-CAT.
MOVE EMP-NUM TO CRT-ERR-VAR1.
MOVE EMP-LASTNAME TO CRT-ERR-VAR2.
MOVE EMP-COMNUM TO CRT-ERR-VAR3.
MOVE EMP-COMNAME TO CRT-ERR-VAR4.
MOVE 20 TO CRT-MSG-NBR.
PERFORM 780-PRINT-MSG.
The following message appears for employee 1934, last name of Smith at company number 53892, which is ACME Shoelaces.
Employee 1934 SMITH works at 53892 ACME Shoelaces company.