CL Command Reference - CHGMSGD

CL Command List > CHGMSGD Reference

Description:

The Change Message Description (CHGMSGD) command changes an existing message description stored in a message file, and stores those changes in that message file for later use. The message description remains in the message file until the file is deleted, until the Remove Message Description (RMVMSGD) command is used to remove the message from the file, or until another change to the message is made with a Change Message Description (CHGMSGD) command.

If the message is sent as an inquiry message or as a notify message and a reply is expected, the following validity-checking parameters can be used to specify some requirements that validate the reply received.
. Reply type (TYPE) parameter.
. Maximum reply length (LEN) parameter.
. Valid reply values (VALUES) parameter.
. Special reply values (SPCVAL) parameter.
. Range of reply values (RANGE) parameter.
. Relationship for valid replies (REL) parameter.
. Default reply value (DFT) parameter.

These parameters are not necessary for a message to allow a reply, but they can be used to define valid replies made to the message.

Caution: Specifying the alert option in the range CPx7B00 to CPx7BFF (messages sent from the alert process) may cause unpredictable results.

Restrictions: To change a message description in a message file, you must have change (*CHANGE) authority for the message file and read (*READ) authority for the library in which the file is located.


Examples:

Example 1: Changing the First-Level Message and Severity

CHGMSGD MSGID(UIN0115) MSGF(INV) MSG(¡¯Enter your name¡¯)
SEV(55)

This command changes the first-level message and the severity of message UIN0115 stored in the message file INV. The rest of the message description remains as originally specified in the ADDMSGD command.



Example 2: Changing to a Range of Valid Replies

Assume the user created message UPY0047 as follows:

ADDMSGD MSGID(UPY0047) MSGF(PAYLIB/TIMECARD)
MSG(¡¯Enter department number:¡¯)
TYPE(*DEC) LEN(4) VALUES(0816 0727 0319 8774)

To change to a range of valid replies (RANGE parameter), instead of specific reply values (as specified with the VALUE parameter), the following command can be used:

CHGMSGD MSGID(UPY0047) MSGF(PAYLIB/TIMECARD) VALUES(*NONE)
RANGE(0300 8900)

The VALUES as originally defined are removed and the RANGE parameters are added to the message description. The type and length of the reply values do not change.

Note: All changes made to an existing message description must be compatible with the existing message description. For example, the following change would be diagnosed as invalid because the RANGE values are not compatible with the reply length as defined on the original ADDMSGD command.



Example 3: Changing the Length Parameter

ADDMSGD MSGID(XYZ0202) MSGF(XYZMSGF)
MSG(¡¯Enter routing code:¡¯)
TYPE(*CHAR) LEN(2) VALUES(AA BB CC DD EE)

CHGMSGD MSGID(XYZ0202) MSGF(XYZMSGF) VALUES(*NONE)
RANGE(AAA ZZZ)

To make the change to the range of reply values valid, the user must also change the length (LEN parameter). The correct command coding would be as follows:

CHGMSGD MSGID(XYZ0202) MSGF(XYZMSGF) LEN(3)
VALUES(*NONE) RANGE(AAA ZZZ)