Message Maintenance

Lawson Software stores messages for programs in a database file. Each message has a number associated with it. When a program has an error or needs to display an informational message, it gives the message number to the system, which displays the message.

The following example shows the program code for displaying an error message in an online program.

090000     PERFORM 840-FIND-GLNSET1.
090100     IF (GLNAMES-NOTFOUND)
090200         MOVE "GL20"                       TO CRT-ERROR-CAT
090300         MOVE 101                          TO CRT-ERROR-NBR
090400         MOVE GL20F2-GLM-ACCT-UNIT-FN      TO CRT-FIELD-NBR
090500         GO TO 210-END.

The program moves the message category to CRT-ERROR-CAT; if no value is moved to CRT-ERROR-CAT, it defaults to the program code. The program then moves the message number to the working storage variable CRT-ERROR-NBR and moves the field number of the field the cursor should be placed on to CRT-FIELD-NBR. Because this is an error, there is no need to process further. The program jumps to the end of the paragraph.

The following example shows the program code for printing an error message in a batch program.

000600     MOVE PRM-COMPANY            TO DB-COMPANY.
000700     PERFORM 840-FIND-GLSSET1.
000800     IF (GLSYSTEM-NOTFOUND)
000900         MOVE "GL"                         TO CRT-ERROR-CAT
001000         MOVE PRM-COMPANY                  TO CRT-ERR-VAR1
001100         MOVE 050                          TO CRT-ERROR-NBR
001200         PERFORM 780-PRINT-ERROR-MSG
001300         GO TO 050-END.

After moving the message category to CRT-ERROR-CAT, the program moves the value of the field in error to the working storage variable CRT-ERR-VAR1 and moves the message number to CRT-ERROR-NBR. It then performs the routine 780-PRINT-ERROR-MSG and jumps to the end of the paragraph. A report program performs different routines depending on the kind of error.