CHGRPYLE (Change Reply List Entry)
CHGRPYLE Command syntax diagram
Purpose
The Change Reply List Entry (CHGRPYLE) command changes a system reply list entry. Any of the attributes of a reply list entry may be changed, except for the sequence number.
The reply list is used as a source for automatic responses to predefined inquiry messages.
The reply list is only used when an inquiry message is sent by a job that has the system reply list attribute INQMSGRPY(*SYSRPYL) specified. The INQMSGRPY attribute can be changed with the CHGJOB command.
New entries may be added to the reply list with the Add Reply List Entry (ADDRPYLE) command; entries can be removed with the Remove Reply List Entry (RMVRPYLE) command. The entire list of entries can be shown with the Work with Reply List Entry (WRKRPYLE) command; from the display presented the user can add, change, and remove individual entries.
Restriction: This command is shipped with public *EXCLUDE authority and the QPGMR user profile has private authority to use the command.
Required Parameters
- SEQNBR
- Specifies the sequence number of the reply list entry being changed. The message identifier and message data of an inquiry message are matched against reply list entry message identifiers and comparison data in ascending sequence number order. The search ends when a match occurs or the last reply list entry is passed. Therefore, if more than one reply list entry matches the inquiry message identifier and comparison data, only the first entry that matches is used. If no reply list entry matches the inquiry message, the inquiry is sent, but no reply is sent unless a default reply would otherwise be sent; the job is not dumped.
Sequence numbers can range from 0001 through 9999. Duplicate sequence numbers are not allowed.
Optional Parameters
- MSGID
- Specifies the inquiry message identifiers for which automatic system action is taken. The message identifier may be specific or generic in scope. Only predefined messages (messages known to the system by a message identifier) can be matched by reply list entries; immediate messages cannot be used for comparison.
If no comparison data is specified, then only the message identifier is used to match the message to this reply list entry. If this is the first entry in the message reply list which matches the message, then the action specified in this entry is taken.
*SAME: The message identifier is not changed.
*ANY: This reply list entry matches any message identifier. Unless this reply list entry has comparison data specified, any reply list entry with a higher sequence number than this one is ignored.
message-identifier: Specify a message identifier to compare with the message identifier of an inquiry message. The message identifier must be seven characters in length and in the format, pppnnnn.
The first three characters (ppp) must be a code consisting of one alphabetic character followed by two alphanumeric (alphabetic or decimal) characters. The last four characters (nnnn) may consist of the decimal numbers 0 through 9 and the alphabetic characters A through F.
To specify a generic message identifier, enter zeros in the rightmost two or four positions of the numeric field, such as pppnn00 or ppp0000. For example, CPA0000 would match any CPA inquiry message, while CPA4200 would match any CPA42xx inquiry message.
- CMPDTA
- Specifies the comparison data that is used to determine whether this entry matches an inquiry message. This parameter is made up of comparison data and a start value for the message data. If the identifier of the inquiry message matches the message identifier of this reply list entry, then the message data specified for the inquiry message is compared to this data. If a message data start value has not been specified, then the first part of the message data (up through the first 28 characters or less) must exactly match the comparison data specified here before the action requested for this reply list entry is taken. However, if a start value has been specified, then the part of the message data beginning with the character position specified in the start value must exactly match the comparison data before any requested action is taken. If the comparison data is longer than the message data, then no match occurs. If no comparison data is specified, then only the message identifier is used to match the message to this reply list entry. If this is the first entry in the message reply list that matches the message, then the action specified in this entry is taken.
Message data for an inquiry message may be specified in the MSGDTA parameter of the Send User Message (SNDUSRMSG) and Send Program Message (SNDPGMMSG) commands for the inquiry message.
Element 1: Comparison Data
*SAME: The value does not change.
*NONE: No comparison data is specified. If the inquiry message has the specified identifier, the action specified by this reply list entry is taken.
'comparison-data': Specify a character string of no more than 28 characters (enclosed in apostrophes if blanks or other special characters are included). This string is compared with a string of the same length in the message data of the inquiry message, beginning with the first character (if no start value has been specified). If the comparison data string matches the inquiry message data string, the action specified by this reply list entry is taken.
Element 2: Message Data Start Position
*SAME: The value does not change.
*NONE: No message comparison data is specified.
message-data-start: Specify the character position in the message's replacement text (maximum value not to exceed 999) to be the point where the comparison data starts being compared with the replacement text. A start value is not valid without a specification of comparison data.
Coded Character Set Identifier (CCSID) Considerations
The text supplied on the CMPDTA parameter that corresponds to the *CCHAR type field is assumed to be in the CCSID of the job running this command unless the CCSID parameter is coded. For more information about the *CCHAR type field see the Add Message Description (ADDMSGD) command.
- RPY
- Specifies how to reply to an inquiry message that matches this reply list entry. The reply specified in this reply list entry is automatically sent by the system without requiring user intervention. The inquiry message does not interrupt or notify any job when the message arrives at the message queue. The inquiry message is not displayed before the reply is sent.
If a reply is not specified in this entry, a manual reply to the inquiry message must be made.
*SAME: The value does not change.
*DFT: The default reply to the inquiry message is sent. If no default reply is specified in the message description of the inquiry message, the system default reply, *N, is used.
*RQD: The inquiry message requires an explicit reply. If the message queue to which the inquiry is sent is in break mode, the message interrupts the job and is shown on the display. If the message queue is in notify mode, the job to which it is allocated is notified. No reply is automatically sent.
'message-reply': Specify a character string of up to 32 characters (enclosed in apostrophes if blanks or other special characters are included), which is sent as a reply to the inquiry message. If this reply is not valid for the inquiry message, the inquiry is sent if RPY(*RQD) has been specified.
- DUMP
- Specifies whether the contents of the job that sent the inquiry message are printed (dumped) when the inquiry message matches this reply list entry. The dump is the same as the dump specified by DMPLST(*JOB) on the Add Message Description (ADDMSGD) command or by the command DSPJOB OUTPUT(*PRINT) for the sending job. A job dump may be requested regardless of the value specified for the RPY parameter.
*SAME: The value does not change.
*NO: The job is not dumped.
*YES: The job is dumped before control returns to the program sending the message.
- CCSID
- Specifies the coded character set identifier (CCSID) of the part of the CMPDTA that is of the type *CCHAR.
When an inquiry message is sent to a job that is using the system reply list, the *CCHAR compare data is converted from the CCSID specified by the Send function to the CCSID of the CMPDTA stored on the reply list This is done before the data is compared.
All other compare data is not converted before a comparison is made. For more information about the message handler and its use of CCSIDs, see the Globalization topic in the Information Center.
Note: When specifying a CCSID other than *HEX, all CMPDTA specified is converted from that CCSID to the job CCSID when displayed on the Work with Reply List Entries panel. This occurs even when all CMPDTA does not correspond with *CCHAR data; therefore, when using a CCSID other than *HEX, specifying the length of the *CCHAR data or any other data field is not recommended. *SAME: The CCSID associated with the CMPDTA does not change. If the CMPDTA is being changed, the part of the CMPDTA that is of the type *CCHAR is assumed to be the same as the CCSID used by the CMPDTA being replaced.
*JOB: If the CMPDTA is being changed, the part of the CMPDTA that is of the type *CCHAR is assumed to be in the CCSID of the JOB executing this command. If the CMPDTA is not changing the CCSID associated with the CMPDTA does not change.
*HEX: The CCSID associated with the CMPDTA is changed to 65535. No conversion occurs before the replacement data is compared with the CMPDTA.
coded-character-set-identifier: The CCSID associated with the CMPDTA parameter is assumed to be the CCSID value specified.
Examples for CHGRPYLE
Example 1: Changing the Message Identifier
CHGRPYLE SEQNBR(20) MSGID(RPG1299)This command changes the message identifier of the reply list entry (sequence number 20) to RPG1299. Whenever an RPG1299 inquiry message is sent by a job that is using the reply list, the action previously specified for entry 20 is taken.
Example 2: Changing the Comparison Data
CHGRPYLE SEQNBR(25) CMPDTA(MYPROGRAM)This command changes the comparison data of the reply list entry whose sequence number is 25 to MYPROGRAM. This entry only matches inquiry messages whose message data begins with MYPROGRAM. For example, if this entry were for the RPG1200 messages, the entry is used only when the RPG program from which the message was sent has message data named MYPROGRAM.
Example 3: Changing the Reply Sent
CHGRPYLE SEQNBR(30) RPY(C)This command changes the reply sent for the reply list entry whose sequence number is 30 to C. Whenever an inquiry message which matches the message identifier and comparison data previously defined for this entry is sent by a job that is using the reply list, a 'C' reply is automatically sent.
Example 4: Printing the Job Contents
CHGRPYLE SEQNBR(40) DUMP(*YES)This command changes the attribute defined for the DUMP parameter for the reply list entry whose sequence number is 40. Whenever this entry matches an inquiry message, the sending job is dumped before control returns to the sending program.
Example 5: Sending a Manual Reply
CHGRPYLE SEQNBR(45) MSGID(CPA5300) CMPDTA(*NONE) RPY(*RQD) DUMP(*NO)This command changes some of the attributes of the reply list entry whose sequence number is 45. Whenever a CPA53xx inquiry message is sent by a job that is using the reply list, a manual reply must be issued. If the message queue to which the inquiry is sent is in break mode, the message interrupts the job. The sending job is not dumped.
Example 6: Sending an Automatic Reply
CHGRPYLE SEQNBR(9999) MSGID(CPA3917) RPY(R)This command changes the reply list entry whose sequence number is 9999. Whenever a CPA3917 inquiry message is sent by a job that is using the reply list, an 'R' reply is automatically sent. The inquiry does not break into the message queue, and no opportunity is given to reply to the message manually.
Error messages for CHGRPYLE
*ESCAPE Messages
- CPF2435
- System reply list not found.
- CPF2436
- System Reply List entry not added or changed.
- CPF247E
- CCSID &1 is not valid.
- CPF2499
- Message identifier &1 not allowed.
- CPF2556
- Sequence number &1 not defined in system reply list.
- CPF2557
- System reply list damaged.
- CPF2558
- System reply list currently in use.