Example: Describe a message

This example shows how to create a message to be used in an application.

In the following example, the Add Message Description (ADDMSGD) command creates a message to be used in applications such as order entry. The message is issued when a customer number entered on the display is not found. The message is:

   Customer number &1 not found

The Add Message Description (ADDMSGD) command for this message is:

ADDMSGD   MSGID(USR4310) +
          MSGF(QGPL/USRMSG)  +
          MSG('Customer number &1 not found') +
          SECLVL('Change customer number') +
          SEV(40) +
          FMT((*CHAR 8))

The message is added to the USRMSG file in the library QGPL.

You can use the DSPMSGD or WRKMSGD command to print or display message descriptions.

The SECLVL parameter provides very simple text. To make this appear on the Additional Message Information display, you specify SECLVL('message text'). The text you specify on this parameter appears on the Additional Message Information display when you press the Help key after placing the cursor on this message.

Related tasks
Send messages from a CL program