Accessing the MQMD header
Code ESQL statements to access the fields of the MQMD header.
About this task
IBM® MQ and WebSphere® MQ Everyplace® messages include an MQMD header.
You can refer to the fields within the MQMD, and you can update them in a Compute node.
For
example, you might want to copy the message identifier MSGID in the
MQMD to another field in your output message. To do that, code:
SET OutputRoot.MRM.Identifier = InputRoot.MQMD.MsgId;
If you send a message to an EBCDIC system from a distributed
system, you might need to convert the message to a compatible CodedCharSetId
and Encoding. To do this conversion, code the following ESQL in the Compute node:
SET OutputRoot.MQMD.CodedCharSetId = 500;
SET OutputRoot.MQMD.Encoding = 785;
The MQMD properties of CodedCharSetId and Encoding define the code page and encoding of the section of the message that follows (typically this is either the MQRFH2 header or the message body itself).
Differences exist in the way the Properties folder and the MQMD folder are treated with respect to which folder takes precedence for the same fields. For more information, see Properties versus MQMD folder behavior for various transports.