mqBufferToBag
The mqBufferToBag call converts the supplied buffer into bag form.
Syntax for mqBufferToBag
- mqBufferToBag (OptionsBag, BufferLength, Buffer, DataBag, CompCode, Reason)
Parameters for mqBufferToBag
- OptionsBag (MQHBAG) - input
-
Handle of the bag containing options that control the processing of the call. This is a reserved parameter; the value must be MQHB_NONE.
- BufferLength (MQLONG) - input
- Length in bytes of the buffer.
- Buffer (MQBYTE x BufferLength) - input
- Pointer to the buffer containing the message to be converted.
- Databag (MQHBAG) - input/output
- Handle of the bag to receive the message. The MQAI performs an mqClearBag call on the bag before placing the message in the bag.
- CompCode (MQLONG) - output
- Completion code.
- Reason (MQLONG) - output
- Reason code qualifying CompCode.
The following reason codes indicating error conditions can be returned from the mqBufferToBag call:
- MQRC_BAG_CONVERSION_ERROR
- Data could not be converted into a bag. This indicates a problem with the format of the data to be converted into a bag (for example, the message is not a valid PCF).
- MQRC_BUFFER_ERROR
- Buffer parameter not valid (invalid parameter address or buffer not accessible).
- MQRC_BUFFER_LENGTH_ERROR
- Buffer length not valid.
- MQRC_HBAG_ERROR
- Bag handle not valid.
- MQRC_INCONSISTENT_ITEM_TYPE
- Data type of second occurrence of selector differs from data type of first occurrence.
- MQRC_OPTIONS_ERROR
- Options bag contains unsupported data items, or a supported option has a value that is not valid.
- MQRC_SELECTOR_OUT_OF_RANGE
- Selector not within valid range for call.
- MQRC_STORAGE_NOT_AVAILABLE
- Insufficient storage available.
- MQRC_SYSTEM_BAG_NOT_ALTERABLE
- System bag cannot be altered or deleted.
Usage notes for mqBufferToBag
The buffer must contain a valid PCF message. The encoding of numeric data in the buffer must be MQENC_NATIVE.
The Coded Character Set ID of the bag is unchanged by this call.
C language invocation for mqBufferToBag
mqBufferToBag (OptionsBag, BufferLength, Buffer, DataBag, &CompCode, &Reason);Declare the parameters as follows:
MQHBAG OptionsBag; /* Options bag handle */ MQLONG BufferLength; /* Buffer length */ MQBYTE Buffer[n]; /* Buffer containing PCF */ MQHBAG DataBag; /* Data bag handle */ MQLONG CompCode; /* Completion code */ MQLONG Reason; /* Reason code qualifying CompCode */
Visual Basic invocation for mqBufferToBag
(Supported on Windows only.)
mqBufferToBag OptionsBag, BufferLength, Buffer, DataBag, CompCode, ReasonDeclare the parameters as follows:
Dim OptionsBag As Long 'Options bag handle' Dim BufferLength As Long 'Buffer length' Dim Buffer As Long 'Buffer containing PCF' Dim DataBag As Long 'Data bag handle' Dim CompCode As Long 'Completion code' Dim Reason As Long 'Reason code qualifying CompCode'