Home

 

Parameters

 

Bag (MQHBAG) – input

Handle of the bag to be truncated. This must be the handle of a bag created by the user, not the handle of a system bag; MQRC_SYSTEM_BAG_NOT_ALTERABLE results if you specify the handle of a system bag.

ItemCount (MQLONG) – input

The number of user items to remain in the bag after truncation. Zero is a valid value.

The ItemCount parameter is the number of data items, not the number of unique selectors. (If there are one or more selectors that occur multiple times in the bag, there will be fewer selectors than data items before truncation.) Data items are deleted from the end of the bag, in the opposite order to which they were added to the bag.

If the number specified exceeds the number of user items currently in the bag, MQRC_ITEM_COUNT_ERROR results.

CompCode (MQLONG) – output

Completion code.

Reason (MQLONG) – output

Reason code qualifying CompCode.

The following reason codes indicating error conditions can be returned from the mqTruncateBag call:

MQRC_HBAG_ERROR

Bag handle not valid.

MQRC_ITEM_COUNT_ERROR

ItemCount parameter not valid (value exceeds the number of user data items in the bag).

MQRC_SYSTEM_BAG_NOT_ALTERABLE

System bag cannot be altered or deleted.

 

Parent topic:

mqTruncateBag


pc17850_


 

Home