Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
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.
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.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
MSGID | Message identifier | Name | Required, Positional 1 |
MSGF | Message file | Qualified object name | Required, Positional 2 |
Qualifier 1: Message file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
MSG | First-level message text | Character value, *SAME | Optional, Positional 3 |
SECLVL | Second-level message text | Character value, *SAME, *NONE, X'' | Optional, Positional 4 |
SEV | Severity code | 0-99, *SAME | Optional, Positional 5 |
FMT | Message data fields formats | Single values: *SAME, *NONE Other values (up to 99 repetitions): Element list |
Optional |
Element 1: Data type | *QTDCHAR, *CHAR, *HEX, *SPP, *DEC, *BIN, *UBIN, *CCHAR, *DTS, *SYP, *ITV | ||
Element 2: Length | Integer, *VARY | ||
Element 3: *VARY bytes or dec pos | Integer, 0 | ||
TYPE | Reply type | *SAME, *NONE, *CHAR, *DEC, *ALPHA, *NAME | Optional |
LEN | Maximum reply length | Single values: *SAME, *NONE, *TYPE Other values: Element list |
Optional |
Element 1: Length | Integer | ||
Element 2: Decimal positions | Integer | ||
VALUES | Valid reply values | Single values: *SAME, *NONE Other values (up to 20 repetitions): Character value |
Optional |
SPCVAL | Special reply values | Single values: *SAME, *NONE Other values (up to 20 repetitions): Element list |
Optional |
Element 1: Original from-value | Character value | ||
Element 2: Replacement to-value | Character value | ||
RANGE | Range of reply values | Single values: *SAME, *NONE Other values: Element list |
Optional |
Element 1: Lower value | Character value | ||
Element 2: Upper value | Character value | ||
REL | Relationship for valid replies | Single values: *SAME, *NONE Other values: Element list |
Optional |
Element 1: Relational operator | *EQ, *LE, *GE, *GT, *LT, *NE, *NL, *NG | ||
Element 2: Value | Character value | ||
DFT | Default reply value | Character value, *SAME, *NONE | Optional |
DFTPGM | Default program to call | Single values: *SAME, *NONE Other values: Qualified object name |
Optional |
Qualifier 1: Default program to call | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
DMPLST | Data to be dumped | Single values: *SAME, *NONE Other values (up to 102 repetitions): 1-99, *JOB, *JOBINT, *JOBDMP |
Optional |
ALROPT | Alert options | Single values: *SAME Other values: Element list |
Optional |
Element 1: Alert type | Character value, *IMMED, *DEFER, *UNATTEND, *NO | ||
Element 2: Resource name variable | 1-99, *NONE | ||
LOGPRB | Log problem | *SAME, *NO, *YES | Optional |
CCSID | Coded character set ID | 1-65535, *SAME, *HEX, *JOB | Optional |
Top |
Specifies the message identifier of the message being changed. The message identifier must be 7 characters long and in the following format: pppnnnn
The first 3 characters (ppp) must be a code consisting of an alphabetic character followed by two alphanumeric (alphabetic or decimal) characters. The last 4 characters (nnnn) must consist of the decimal numbers 0 through 9 and the characters A through F.
This is a required parameter.
Top |
Specifies the message file where the message description being changed is stored. This command ignores any message file overrides in effect for the job.
This is a required parameter.
Qualifier 1: Message file
Qualifier 2: Library
Top |
Specifies the new text for the message.
Note: If the message text is changing, the entire message text is replaced with the specified change.
One or more substitution variables can be embedded in the message text string to indicate positional replacement fields that allow the program to substitute variable data in the message before the message is sent.
Double-Byte Character Set Considerations
When entering double-byte characters on this parameter, several combinations of characters may cause errors to occur on this command. The double-byte characters should not contain the string, X'50Fn' (where n is a 1-digit number, 0-9). Examples are: X'50F0', X'50F4', X'50F9'.
Coded Character Set Identifier (CCSID) Considerations
The text supplied for the MSG parameter is assumed to be in the CCSID of the job calling this command unless the CCSID parameter is coded. If the CCSID parameter is coded, the text is assumed to be in the CCSID specified. For more information about the message handler and its use of CCSIDs, see the Globalization topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Specifies any message help changes. Message help can also be written to the job log, if *SECLVL is specified for the Log in service log (LOG) parameter of the job commands.
Message help can be formatted for the work station using three format control characters. Each must be followed by a blank.
Double-Byte Character Set Considerations
When entering double-byte characters on this parameter, several combinations of characters may cause errors to occur on this command. The double-byte characters should not contain the string, X'50Fn' (where n is a 1-digit number, 0-9). Examples are: X'50F0', X'50F4', X'50F9'.
Coded Character Set Identifier (CCSID) Considerations
The text supplied for the SECLVL parameter is assumed to be in the CCSID of the job calling this command unless the CCSID parameter is coded. If the CCSID parameter is coded, the text is assumed to be in the CCSID specified. For more information about the message handler and its use of CCSIDs, see the Globalization topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Specifies the severity code of the message being changed. The severity code indicates the severity level of the condition that causes the message to be sent.
Top |
Specifies the formats of from one to 99 message data fields being changed. Each field is described in this parameter by a list of attributes. All 99 of the message data fields can be used as substitution values in the message and message help defined in this message description. They can also be specified for the Data to be dumped (DMPLST) parameter of this command. When specified for the Message data field values (MSGDTA) parameter of the Send Program Message (SNDPGMMSG) or Send User Message (SNDUSRMSG) command, the data fields must be concatenated to form one character string of no more than 512 characters and must match the format and sequence specified here.
Note: If any of the previously defined formats are being changed, all existing formats must be included in this parameter.
Single values
Note: If a format had been originally specified, but *NONE is specified, all referrals to those formats must be removed from the message and message help and from the dump list.
Element 1: Data type
The first element specifies the type of data the substitution field contains and how the data is to be formatted in the message text. The contents of the second and third elements vary depending on the type specified. One of the following types can be specified for each field described by this parameter:
The following formats are valid only in IBM-provided message descriptions and should not be used for other messages.
Element 2: Length
After the type specification, a second element can be specified to indicate the number of characters or digits that are passed in the message data. How the second element is used depends on the type specified in the first element.
Element 3: *VARY bytes or dec pos
The third element is used in one of two ways, depending on the type specified in the first element: (1) if *QTDCHAR, *CHAR, *CCHAR, *HEX, or *SPP is specified, and if *VARY is specified or assumed for the second element, the third element is used with *VARY to indicate the size of the length field actually passed. The third element can be either a 2 or a 4, which is the number of bytes specifying the length (in binary) of the passed value; (2) if *DEC is specified, the third element indicates the number of decimal positions in the decimal value. If not specified for a decimal substitution value, the default is 0 decimal positions.
Note: If an object has been damaged or deleted, the substitution variable, when displayed, is not replaced by the name of the object. Instead, the object appears as &n (where n = number).
Top |
Specifies, only if the message is sent as an inquiry or notify message, the type of valid reply to this message.
Top |
Specifies, only if the message is sent as an inquiry or notify message, the maximum reply length.
Single values
Element 1: Length
Element 2: Decimal positions
Top |
Specifies, only if the message is sent as an inquiry or notify message, a list of values of which one can be received as a valid reply. No more than 20 values can be specified in the list. Each value in the list must meet the requirements specified for message replies on the Reply type (TYPE) parameter and the Maximum reply length (LEN) parameter. If this parameter is specified, the Range of reply values (RANGE) parameter and the Relationship for valid replies (REL) parameter cannot be specified.
Single values
Other values
Top |
Specifies, only if the message is sent as an inquiry or notify message, a list of up to 20 sets of special values of which one set (if the from-value is matched by the sent reply) is used as the reply. These values are special in that they may not meet all the validity checking specifications given in the other reply-oriented parameters. The reply sent is compared to the from-value in each set. If a match is found, and a to-value was specified in that set, the to-value is sent as the reply. If no to-value was specified, the from-value is sent as the reply. If the reply sent does not match any from-value, then the reply is validity-checked by the specifications in the other reply-oriented parameters.
Single values
Element 1: Original from-value
Element 2: Replacement to-value
Top |
Specifies, only if the message is sent as an inquiry or notify message, the upper and lower value limits for valid replies to this message. These values must meet the requirements specified for replies by the TYPE and LEN parameters, and both values must be of the same type. If both values are not of the same length, the shorter value is padded on the right with blanks. For type *CHAR and *ALPHA replies, the reply is padded on the right with blanks or truncated on the right (to the length of the specified values) before the value range is validity-checked. If this parameter is specified, the Valid reply values (VALUES) parameter and the Relationship for valid replies (REL) parameter cannot be specified.
Single values
Element 1: Lower value
Element 2: Upper value
Top |
Specifies, only if the message is sent as an inquiry or notify message, the relationship that must exist for a reply to be valid. The value specified must meet the requirements specified for replies on the Reply type (TYPE) parameter and the Maximum reply length (LEN) parameter. For replies of the types *CHAR and *ALPHA, the reply is padded on the right with blanks or truncated on the right to match the length of the value specified, before the system performs the test on the reply value sent.
Single values
Element 1: Relational operator
Element 2: Value
Top |
Specifies, only if the message is sent as an inquiry or notify message, the default reply (enclosed in apostrophes, if it contains special characters) used when the receiver of the message has indicated that all messages to him are to use default replies, or when a message is deleted from a message queue and no reply was specified. The default reply can also be used to answer notify messages that are not monitored. The default reply must meet the requirements specified for replies by the validity-checking parameters.
Top |
Specifies the default program (if any) to take default action when this message is sent as an escape message to a program that is not monitoring for it.
Single values
Qualifier 1: Default program to call
Qualifier 2: Library
Top |
Specifies the data dumped when this message is sent as an escape message to a program that is not monitoring for it. This parameter can specify that data related to the job be dumped, that data from message data fields be dumped, or that a combination of these be dumped. When data from message data fields is dumped, this parameter specifies one or more numbers that identify, by position, the data fields being dumped.
The system objects indicated by system pointers are dumped. The data in a space object, indicated by a space pointer, is dumped starting from the offset indicated by the space pointer for the length indicated in the field description. The standard job dump can also be requested.
Single values
Other values
Top |
Specifies the alert option associated with messages sent to the QHST log and the system operator message queue.
Single values
Element 1: Alert type
Element 2: Resource name variable
Top |
Specifies, for IBM-supplied messages, whether or not an entry can be put into the problem log. If there is an error log ID for the message and *YES is specified for this parameter, you can request problem analysis by pressing F14 from the system operator message queue display (by running DSPMSG *SYSOPR command).
Top |
Specifies the coded character set identifier (CCSID) that the text supplied for the MSG and SECLVL parameters is in.
If the MSG and SECLVL parameters are not coded, the value supplied for the CCSID parameter is used to change the CCSID tag associated with the message description. No text conversion occurs in this case. Use the CCSID parameter in this way to correct a message description that has an incorrect CCSID tag.
If either the MSG or the SECLVL parameters are coded along with the CCSID parameter, the text supplied for the MSG and SECLVL parameters will be assumed to be in the CCSID specified. If only one of the MSG or SECLVL parameters is coded, but not both, any existing text associated with the parameter that is not coded is converted to the specified CCSID so that all the text is in the same CCSID.
If the message file is anything other than 65535 or 65534, the text is converted from the CCSID specified to the CCSID of the message file. Otherwise, the CCSID specified is saved with the MSG description in the event a conversion is needed during a retrieve or display function.
If the CCSID specified does not match the character encoding of the message description, unpredictable results may occur.
To use the CCSID associated with the message description, the CCSID associated with the message file must be 65534. See the Change Message File (CHGMSGF) command for details on how to change the CCSID associated with the message file.
The CCSID only applies to the first level message text and the second level message text of the message description.
If the MSG and SECLVL parameters are specified, the text supplied in these parameters is assumed to be in the CCSID specified. For more information about the message handler and its use of CCSIDs, see the Globalization topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
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)
Top |
*ESCAPE Messages
Top |