cwbDQ_Clear

Purpose

Remove all messages from the iSeries™ data queue object that is identified by the specified handle. If the queue is keyed, messages for a particular key may be removed by specifying the key and key length. These values should be set to NULL and zero, respectively, if you want to clear all messages from the queue.

Syntax

 
unsigned int CWB_ENTRY cwbDQ_Clear(
                             cwbDQ_QueueHandle   queueHandle,
                             unsigned char      *key,
                             unsigned short      keyLength,
                             cwbSV_ErrHandle     errorHandle);

Parameters

cwbDQ_QueueHandle queueHandle - input
Handle that was returned by a previous call to the cwbDQ_Open function. This identifies the iSeries data queue object.
unsigned char * key - input
Pointer to the key. The key may contain embedded NULLs, so it is not an ASCIIZ string.
unsigned short keyLength - input
Length of the key in bytes.
cwbSV_ErrHandle errorHandle - output
Any returned messages will be written to this object. It is created with the cwbSV_CreateErrHandle API. The messages may be retrieved through the cwbSV_GetErrText API. If the parameter is set to zero, no messages will be retrieved.

Return Codes

The following list shows common return values.

CWB_OK
Successful completion.
CWBDQ_INVALID_QUEUE_HANDLE
Invalid queue handle.
CWBDQ_BAD_KEY_LENGTH
Length of key is not correct.
CWBDQ_REJECTED_USER_EXIT
Command rejected by user exit program.

Usage

This function requires that you have previously issued: