Message format (-FORMAT)

Use the Message Format adapter command (-FORMAT) for data targets to specify the format of the application data in the message. Either pre-existing (defined by IBM® MQ) or custom (user-defined) message formats can be used.

-FORMAT message_format
A message format, either pre-existing (predefined by IBM MQ) or custom (user-defined). The format can contain up to eight (8) characters. If less than eight, it will be padded with spaces.

For example, to specify MQFMT_STRING as the format of the message, the following adapter command should be used:


where MQSTR is the value of the MQFMT_STRING message format. For information about other built-in message formats, see your IBM MQ documentation.

You must always specify a value when using the -FORMAT adapter command. Failure to do so will result in map failure and a corresponding error message is generated.

If you use a user-defined format, you must also provide the corresponding data-conversion exit so that receiving applications can read the message using the MQGMO_CONVERT option. For HCL Integration Platform applications, this means using the -CVT adapter command for the IBM MQ inputs.

If the message format is not provided (either with the usage of the -FORMAT adapter command or through the message descriptor type tree with the -HDR/-DH adapter command), the MQFMT_STRING message format is used as a default value.

To specify a format value that has spaces interleaved with text (or all spaces), use double quotes.

For example:

-FORMAT "ab cd"


to specify a blank format (all spaces), you can insert eight (8) spaces in double quotes:

-FORMAT "        "

Note that the value of the -FORMAT adapter command is the value of the predefined format constant, not the name of the constant.

For example, use:




and not:


MQFMT_STRING is the name of the predefined IBM MQ message format constant, and its value is "MQSTR "