Command reference / msg
CHGMSGQ
Change Message Queue
Updates message queue attributes such as delivery mode, delivery severity and the handling of full queues.
Allowed environments: *ALL.
Positional parameters: 2.
Parameters
MSGQ
Message queue
Enter the name of the message queue whose attributes are being changed.
Suggested / special values:
*USRPRF, *WRKSTN
*WRKSTN- The attributes of the work station's message queue are being changed. (This parameter is not valid for a batch job.)
*USRPRF- The attributes of the message queue associated with the currrent user profile are being changed.
*ALL (message queue)- All message queues in the libraries identified in the library qualifier are changed.
generic*-message-queue-name- Enter the generic name of the message queue whose attributes are being changed. A generic name is a character string of one or more characters followed by an asterisk (*); for example, ABC*.
name (message queue)- Enter the name of the message queue whose attributes are to be changed.
*LIBL- Look in the thread's library list.
*CURLIB- The current library for the job is used to locate the message queue. If no current library entry exists in the library list, QGPL is used.
*USRLIBL- Only the libraries in the user portion of the thread's library list are searched.
*ALL (library)- All libraries in the system, including QSYS, are searched.
*ALLUSR- All user libraries are searched.
name (library)- Enter the library where the message queue is located.
Qualified parts (object, then library; write LIBRARY/OBJECT)
Message queue
Message queue
Library
Library
Suggested / special values:
*LIBL, *CURLIB
DLVRY
Delivery
Select how the messages that are sent to this message queue are delivered. The method of delivery is in effect only as long as the message queue is allocated to the job. When the queue is no longer allocated, the delivery mode is changed to *HOLD for work station, system operator, and user message queues. Note: When the delivery mode of a message queue is changed to *BREAK or *NOTIFY, the message queue is allocated with an *EXCL lock.
Allowed values:
*SAME, *HOLD, *BREAK, *NOTIFY, *DFT
*SAME- Keep the current method of message delivery. If this parameter has not been changed in a previous command, *SAME means that *HOLD is the method of delivery.
*HOLD- The messages are held in the message queue until they are requested by the user or program.
*BREAK- When a message arrives at the message queue, the job to which the message queue is allocated is interrupted, and the program specified for the Break handling program (PGM) parameter is called, or the Display Message (DSPMSG) command is processed.
*NOTIFY- When a message arrives at the message queue, an interactive job to which the message queue is allocated is notified by the message light turning on and a buzzer sounding (if you have that feature).
*DFT- Messages requiring replies are answered with their default reply. If no default reply is specified in the message description of the inquiry message, the system default reply, *N, is used.
SEV
Severity code filter
Sets the lowest severity level that a message can have and still be delivered to a user in break or notify mode.
Suggested / special values:
*SAME
*SAME- Keep the current severity code.
severity-code- Enter a value, 0 through 99, that specifies the lowest severity code that a message can have and still be delivered to a user if the message queue is in break or notify delivery mode.
TEXT
Text 'description'
Sets the user-defined text that describes the message queue. The text specified here replaces any previous text.
Suggested / special values:
*SAME, *BLANK
*SAME- Keep the current text.
*BLANK- Leave the description blank.
'description'- Enter no more than 50 characters, enclosed in apostrophes.
PGM
Break handling program
Two elements are used to specify the program parameter. The first element specifies the program called when a message arrives at the message queue and break delivery has been specified.
Suggested / special values:
*SAME, *DSPMSG
*SAME- The same program, if any, is called. (If this parameter has not been changed previously in another Change Message Queue (CHGMSGQ) command, *SAME means that *DSPMSG and *ALWRPY are assumed.) When changing to *BREAK mode and if this parameter is not specified or if *SAME is specified, then the break program defaults to *DSPMSG and the allow other jobs to reply value is set to *ALWRPY.
*DSPMSG- The Display Message (DSPMSG command) is processed when a message arrives for break delivery and the allow other jobs to reply value is set to *ALWRPY. For interactive jobs, the messages are shown on the display.
(break handling program)- Qualifier 1: Break handling program name Specify the name of the program to be called.
name (break handling program)- Enter the name of the program to be called.
(2)- Qualifier 2: Library *LIBL All libraries in the library list for the current thread are searched until the first match is found. *CURLIB The current library for the job is used to locate the program.
*LIBL- Look in the thread's library list.
*CURLIB- The current library for the job is used to locate the program. If no current library entry exists in the library list, QGPL is used.
name (library)- Enter the library where the program is located.
*NOALWRPY- When the message queue is in *BREAK mode with a break handling program other than *DSPMSG specified, other jobs can display the message queue, but cannot reply to inquiry messages on the message queue.
*ALWRPY- When the message queue is in *BREAK mode with a break handling program other than *DSPMSG specified, other jobs can reply to inquiry messages on the message queue.
Elements in order
Break handling program
Break handling program
Qualified parts (object, then library; write LIBRARY/OBJECT)
Break handling program
Break handling program
Library
Library
Suggested / special values:
*LIBL, *CURLIB
Allow other jobs to reply
Allow other jobs to reply
Allowed values:
*NOALWRPY, *ALWRPY
RESET
Reset old messages
Controls whether old messages (messages that have been received once and were not removed from the message queue) held in the message queue are reset to the new message status. The messages can then be received in first-in, first-out (FIFO) order as they were originally.
Allowed values:
*NO, *YES
*NO- Old messages in the message queue are not reset to new message status. To receive an old message, reply to it, or remove it, you must enter the message reference key.
*YES- All messages in the message queue, except inquiry messages that have been sent a reply, are reset to the new message status. These messages can then be received as new messages in the same order that they were sent to the message queue.
FORCE
Force to auxiliary storage
Controls whether changes made to the message queue description or messages added to or removed from the queue are immediately forced into auxiliary storage; this ensures that changes to the queue, or messages sent or received, are not lost if a system failure occurs.
Allowed values:
*SAME, *NO, *YES
*SAME- Keep the current value specified in the referred to message queue.
*NO- Changes made to the message queue, including its messages, are not immediately forced to auxiliary storage.
*YES- All changes to the message queue description and to the messages in the queue are immediately forced to auxiliary storage. Warning: This could result in program performance problems.
ALWALR
Allow alerts
Controls whether the queue being changed allows alerts to be generated from alert messages that are sent to it.
Allowed values:
*SAME, *NO, *YES
*SAME- Keep the current value.
*NO- Does not allow alerts to be generated from this message queue.
*YES- Allows alerts to be generated from this message queue.
MSGQFULL
Message queue full action
Sets the action to take when the message queue is full.
Allowed values:
*SAME, *SNDMSG, *WRAP
*SAME- Keep the current setting.
*SNDMSG- When the message queue is full, CPF2460 (Message queue could not be extended.) is sent to the program or user that is sending a message to the full message queue.
*WRAP- When the message queue is full, the oldest informational and answered messages are removed from the message queue to allow space for new messages to be added.
Examples
CHGMSGQ MSGQ(JONES) DLVRY(*NOTIFY)
Changes the method of delivery of the message queue named JONES to notify mode.
CHGMSGQ MSGQ(INV) DLVRY(*BREAK) PGM(INVUPDT)
Changes the delivery mode of the message queue named INV to *BREAK and calls a program named INVUPDT when a message arrives at INV.
Generated from os/cl/catalog/CHGMSGQ.json and os/cl/help/CHGMSGQ.json.