Start of change

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 for the library, and
  • *OBJOPR and *READ authority for the *DTAQ
Read syntax diagramSkip visual syntax diagramCLEAR_DATA_QUEUE( DATA_QUEUE => data-queue,DATA_QUEUE_LIBRARY => data-queue-library,KEY_DATA => key-data,KEY_ORDER => key-order )

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.
The length of key-data must be the length specified on the KEYLEN parameter on the Create Data Queue (CRTDTAQ) command. The KEY_LENGTH column of the QSYS2.DATA_QUEUE_INFO view contains this value.
When this parameter is specified, key-order must also be specified.
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
This parameter is ignored if key-data is not specified.

Example

Clear all entries from data queue DQ1 in library TESTLIB.


    CALL QSYS2.CLEAR_DATA_QUEUE('DQ1', 'TESTLIB');  
End of change