Data conversion processing in the MQAI

The strings contained in an MQAI data bag can be in a variety of coded character sets. These strings can be converted using the mqSetInteger call.

Like PCF messages, the strings contained in an MQAI data bag can be in a variety of coded character sets. Usually, all of the strings in a PCF message are in the same coded character set; that is, the same set as the queue manager.

Each string item in a data bag contains two values; the string itself and the CCSID. The string that is added to the bag is obtained from the Buffer parameter of the mqAddString or mqSetString call. The CCSID is obtained from the system item containing a selector of MQIASY_CODED_CHAR_SET_ID. This is known as the bag CCSID and can be changed using the mqSetInteger call.

When you inquire the value of a string contained in a data bag, the CCSID is an output parameter from the call.

Table 1 shows the rules applied when converting data bags into messages and vice versa:

MQAI call CCSID Input to call Output to call
mqBagToBuffer Bag CCSID ( 1 ) Ignored Unchanged
mqBagToBuffer String CCSIDs in bag Used Unchanged
mqBagToBuffer String CCSIDs in buffer Not applicable Copied from string CCSIDs in bag
mqBufferToBag Bag CCSID ( 1 ) Ignored Unchanged
mqBufferToBag String CCSIDs in buffer Used Unchanged
mqBufferToBagmqBufferToBag String CCSIDs in bag Not applicable Copied from string CCSIDs in buffer
mqPutBag MQMD CCSID Used Unchanged ( 2 )
mqPutBag Bag CCSID ( 1 ) Ignored Unchanged
mqPutBag String CCSIDs in bag Used Unchanged
mqPutBag String CCSIDs in message sent Not applicable Copied from string CCSIDs in bag
mqGetBag MQMD CCSID Used for data conversion of message Set to CCSID of data returned ( 3 )
mqGetBag Bag CCSID ( 1 ) Ignored Unchanged
mqGetBag String CCSIDs in message Used Unchanged
mqGetBag String CCSIDs in bag Not applicable Copied from string CCSIDs in message
mqExecute Request-bag CCSID Used for MQMD of request message ( 4 ) Unchanged
mqExecute Reply-bag CCSID Used for data conversion of reply message ( 4 ) Set to CCSID of data returned ( 3 )
mqExecute String CCSIDs in request bag Used for request message Unchanged
mqExecute String CCSIDs in reply bag Not applicable Copied from string CCSIDs in reply message
Notes:
  1. Bag CCSID is the system item with selector MQIASY_CODED_CHAR_SET_ID.
  2. MQCCSI_Q_MGR is changed to the actual queue manager CCSID.
  3. If data conversion is requested, the CCSID of data returned is the same as the output value. If data conversion is not requested, the CCSID of data returned is the same as the message value. Note that no message is returned if data conversion is requested but fails.
  4. If the CCSID is MQCCSI_DEFAULT, the queue manager's CCSID is used.

Parent topic: Advanced MQAI topics


Related concepts