CLEAR_DATA_QUEUE procedure
The CLEAR_DATA_QUEUE procedure clears all messages from the specified data queue or clears messages that match the key provided.
This procedure provides function similar to the Clear Data Queue (QCLRDTAQ) API.
Authorization: The caller must have:
- *EXECUTE authority to the library containing the data queue, and
- *OBJOPR and *READ authority to the data queue.
The schema is QSYS2.
- data-queue
- A character or graphic string containing the name of the data queue.
- data-queue-library
- A character or graphic string containing the name of the library containing the data queue. Can
be one of the following special values:
- *CURLIB
- The job's current library is used.
- *LIBL
- The library list is used. This is the default.
- key-data
- A character string containing the data to use as the key for selecting messages to be removed from the data queue. This parameter can only be specified for a keyed data queue. If this parameter is not specified, all messages will be cleared from the data queue.
- key-order
- The comparison criteria between the keys of messages on the data queue and the key-data
parameter. Valid values are:
- EQ
- Equal
- GE
- Greater than or equal
- GT
- Greater than
- LE
- Less than or equal
- LT
- Less than
- NE
- Not equal
Example
Clear all entries from data queue DQ1 in library TESTLIB.
CALL QSYS2.CLEAR_DATA_QUEUE('DQ1', 'TESTLIB');