Format (MQCHAR8)
This is a name that the sender of the message uses to indicate to the receiver the nature of the data in the message. Any characters that are in the character set of the queue manager can be specified for the name, but we must restrict the name to the following:
- Uppercase A through Z
- Numeric digits 0 through 9
If other characters are used, it might not be possible to translate the name between the character sets of the sending and receiving queue managers.
Pad the name with blanks to the length of the field, or use a null character to terminate the name before the end of the field; the null and any subsequent characters are treated as blanks. Do not specify a name with leading or embedded blanks. For the MQGET call, the queue manager returns the name padded with blanks to the length of the field.
The queue manager does not check that the name complies with the recommendations described above.
Names beginning MQ in upper, lower, and mixed case have meanings that are defined by the queue manager; do not use names beginning with these letters for the own formats. The queue manager built-in formats are:
- MQFMT_NONE
- The nature of the data is undefined: the data cannot be converted when the message is retrieved from a queue using the MQGMO_CONVERT option.
If you specify MQGMO_CONVERT on the MQGET call, and the character set or encoding of data in the message differs from that specified in the MsgDesc parameter, the message is returned with the following completion and reason codes (assuming no other errors):
- Completion code MQCC_WARNING and reason code MQRC_FORMAT_ERROR if the MQFMT_NONE data is at the beginning of the message.
- Completion code MQCC_OK and reason code MQRC_NONE if the MQFMT_NONE data is at the end of the message (that is, preceded by one or more MQ header structures). The MQ header structures are converted to the requested character set and encoding in this case.
For the C programming language, the constant MQFMT_NONE_ARRAY is also defined; this has the same value as MQFMT_NONE, but is an array of characters instead of a string.
- MQFMT_ADMIN
- The message is a command-server request or reply message in programmable command format (PCF). Messages of this format can be converted if the MQGMO_CONVERT option is specified on the MQGET call. See Use Programmable Command Formats for more information about using programmable command format messages.
For the C programming language, the constant MQFMT_ADMIN_ARRAY is also defined; this has the same value as MQFMT_ADMIN, but is an array of characters instead of a string.
- MQFMT_CICS
- The message data begins with the CICS
information header MQCIH, followed by the application data. The format name of the application data
is given by the Format field in the MQCIH structure.
On z/OS, specify the MQGMO_CONVERT option on the MQGET call to convert messages that have format MQFMT_CICS.
For the C programming language, the constant MQFMT_CICS_ARRAY is also defined; this has the same value as MQFMT_CICS, but is an array of characters instead of a string.
- MQFMT_COMMAND_1
- The message is an MQSC command-server reply message containing the object count, completion code, and reason code. Messages of this format can be converted if the MQGMO_CONVERT option is specified on the MQGET call.
For the C programming language, the constant MQFMT_COMMAND_1_ARRAY is also defined; this has the same value as MQFMT_COMMAND_1, but is an array of characters instead of a string.
- MQFMT_COMMAND_2
- The message is an MQSC command-server reply message containing information about the objects requested. Messages of this format can be converted if the MQGMO_CONVERT option is specified on the MQGET call.
For the C programming language, the constant MQFMT_COMMAND_2_ARRAY is also defined; this has the same value as MQFMT_COMMAND_2, but is an array of characters instead of a string.
- MQFMT_DEAD_LETTER_HEADER
- The message data begins with the dead-letter header MQDLH. The data from the original message
immediately follows the MQDLH structure. The format name of the original message data is given by
the Format field in the MQDLH structure; see MQDLH - Dead-letter header for
details of this structure. Messages of this format can be converted if the MQGMO_CONVERT option is
specified on the MQGET call.
COA and COD reports are not generated for messages that have a Format of MQFMT_DEAD_LETTER_HEADER.
For the C programming language, the constant MQFMT_DEAD_LETTER_HEADER_ARRAY is also defined; this has the same value as MQFMT_DEAD_LETTER_HEADER, but is an array of characters instead of a string.
- MQFMT_DIST_HEADER
- The message data begins with the distribution-list header MQDH; this includes the arrays of MQOR
and MQPMR records. The distribution-list header can be followed by additional data. The format of
the additional data (if any) is given by the Format field in the
MQDH structure; see MQDH - Distribution header for details of this structure. Messages with format
MQFMT_DIST_HEADER can be converted if the MQGMO_CONVERT option is specified on the MQGET call.
This format is supported in the following environments:
- AIX
- IBM i
- Linux
- Windows
and for IBM MQ MQI clients connected to these systems.
For the C programming language, the constant MQFMT_DIST_HEADER_ARRAY is also defined; this has the same value as MQFMT_DIST_HEADER, but is an array of characters instead of a string.
- MQFMT_EMBEDDED_PCF
- Format for a trace-route message, provided that the PCF command value is set to
MQCMD_TRACE_ROUTE. Using this format allows user data to be sent along with the trace-route message,
provided that their applications can cope with preceding PCF parameters.
The PCF header must be the first header, or the message will not be treated as a trace-route message. This means that the message cannot be in a group, and that trace-route messages cannot be segmented. If a trace-route message is sent in a group the message is rejected with reason code MQRC_MSG_NOT_ALLOWED_IN_GROUP.
Note that MQFMT_ADMIN can also be used for the format of a trace-route message, but in this case no user data can be sent along with the trace-route message.
- MQFMT_EVENT
- The message is an MQ event message that reports an event that occurred. Event messages have the same structure as programmable commands; see PCF command messages for more information about this structure, and Event monitoring for information about events.
Version-1 event messages can be converted in all environments if the MQGMO_CONVERT option is specified on the MQGET call. Version-2 event messages can be converted only on z/OS.
For the C programming language, the constant MQFMT_EVENT_ARRAY is also defined; this has the same value as MQFMT_EVENT, but is an array of characters instead of a string.
- MQFMT_IMS
- The message data begins with the IMS information
header MQIIH, which is followed by the application data. The format name of the application data is
given by the Format field in the MQIIH structure.
For details of how MQIIH structure is handled when using MQGET with MQGMO_CONVERT, see Format (MQCHAR8) and ReplyToFormat (MQCHAR8).
For the C programming language, the constant MQFMT_IMS_ARRAY is also defined; this has the same value as MQFMT_IMS, but is an array of characters instead of a string.
- MQFMT_IMS_VAR_STRING
- The message is an IMS variable string, which is
a string of the form llzzccc, where:
- ll
- is a 2-byte length field specifying the total length of the IMS variable string item. This length is equal to the length of ll (2 bytes), plus the length of zz (2 bytes), plus the length of the character string itself. ll is a 2-byte binary integer in the encoding specified by the Encoding field.
- zz
- is a 2-byte field containing flags that are significant to IMS. zz is a byte string consisting of two MQBYTE fields, and is transmitted without change from sender to receiver (that is, zz is not subject to any conversion).
- ccc
- is a variable-length character string containing ll-4 characters. ccc is in the character set specified by the CodedCharSetId field.
On z/OS, the message data can consist of a sequence of IMS variable strings butted together, with each string being of the form llzzccc. There must be no bytes skipped between successive IMS variable strings. This means that if the first string has an odd length, the second string will be misaligned, that is, it will not begin on a boundary that is a multiple of two. Take care when constructing such strings on machines that require alignment of elementary data types.
Use the MQGMO_CONVERT option on the MQGET call to convert messages that have format MQFMT_IMS_VAR_STRING.
For the C programming language, the constant MQFMT_IMS_VAR_STRING_ARRAY is also defined; this has the same value as MQFMT_IMS_VAR_STRING, but is an array of characters instead of a string.
- MQFMT_MD_EXTENSION
- The message data begins with the message-descriptor extension MQMDE, and is optionally followed
by other data (usually the application message data). The format name, character set, and encoding
of the data that follow the MQMDE are given by the Format,
CodedCharSetId, and Encoding fields in the MQMDE. See MQMDE - Message descriptor extension for details of this structure. Messages of this format can be converted if
the MQGMO_CONVERT option is specified on the MQGET call.
For the C programming language, the constant MQFMT_MD_EXTENSION_ARRAY is also defined; this has the same value as MQFMT_MD_EXTENSION, but is an array of characters instead of a string.
- MQFMT_PCF
- The message is a user-defined message that conforms to the structure of a programmable command format (PCF) message. Messages of this format can be converted if the MQGMO_CONVERT option is specified on the MQGET call. See Use Programmable Command Formats for more information about using programmable command format messages.
For the C programming language, the constant MQFMT_PCF_ARRAY is also defined; this has the same value as MQFMT_PCF, but is an array of characters instead of a string.
- MQFMT_REF_MSG_HEADER
- The message data begins with the reference message header MQRMH, and is optionally followed by
other data. The format name, character set, and encoding of the data is given by the
Format, CodedCharSetId, and Encoding fields in
the MQRMH. See MQRMH - Reference message header for details of this structure. Messages of this format
can be converted if the MQGMO_CONVERT option is specified on the MQGET call. This format is
supported in the following environments:
- AIX
- IBM i
- Linux
- Windows
and for IBM MQ MQI clients connected to these systems.
For the C programming language, the constant MQFMT_REF_MSG_HEADER_ARRAY is also defined; this has the same value as MQFMT_REF_MSG_HEADER, but is an array of characters instead of a string.
- MQFMT_RF_HEADER
- The message data begins with the rules and formatting header MQRFH, and is optionally followed
by other data. The format name, character set, and encoding of the data (if any) are given by the
Format, CodedCharSetId, and Encoding fields in
the MQRFH. Messages of this format can be converted if the MQGMO_CONVERT option is specified on the
MQGET call.
For the C programming language, the constant MQFMT_RF_HEADER_ARRAY is also defined; this has the same value as MQFMT_RF_HEADER, but is an array of characters instead of a string.
- MQFMT_RF_HEADER_2
- The message data begins with the version-2 rules and formatting header MQRFH2, and is optionally
followed by other data. The format name, character set, and encoding of the optional data (if any)
are given by the Format, CodedCharSetId, and
Encoding fields in the MQRFH2. Messages of this format can be converted if the
MQGMO_CONVERT option is specified on the MQGET call.
For the C programming language, the constant MQFMT_RF_HEADER_2_ARRAY is also defined; this has the same value as MQFMT_RF_HEADER_2, but is an array of characters instead of a string.
- MQFMT_STRING
- The application message data can be either an SBCS string (single-byte character set), or a DBCS string (double-byte character set). Messages of this format can be converted if the MQGMO_CONVERT option is specified on the MQGET call.
For the C programming language, the constant MQFMT_STRING_ARRAY is also defined; this has the same value as MQFMT_STRING, but is an array of characters instead of a string.
- MQFMT_TRIGGER
- The message is a trigger message, described by the MQTM structure; see MQTM - Trigger message for details of this structure. Messages of this format can be converted if the MQGMO_CONVERT option is specified on the MQGET call.
For the C programming language, the constant MQFMT_TRIGGER_ARRAY is also defined; this has the same value as MQFMT_TRIGGER, but is an array of characters instead of a string.
- MQFMT_WORK_INFO_HEADER
- The message data begins with the work information header MQWIH, which is followed by the
application data. The format name of the application data is given by the Format
field in the MQWIH structure.
On z/OS, specify the MQGMO_CONVERT option on the MQGET call to convert the user data in messages that have format MQFMT_WORK_INFO_HEADER. However, the MQWIH structure itself is always returned in the queue manager's character set and encoding (that is, the MQWIH structure is converted whether or not the MQGMO_CONVERT option is specified).
For the C programming language, the constant MQFMT_WORK_INFO_HEADER_ARRAY is also defined; this has the same value as MQFMT_WORK_INFO_HEADER, but is an array of characters instead of a string.
- MQFMT_XMIT_Q_HEADER
- The message data begins with the transmission queue header MQXQH. The data from the original
message immediately follows the MQXQH structure. The format name of the original message data is
given by the Format field in the MQMD structure, which is part of the transmission
queue header MQXQH. See MQXQH - Transmission-queue header for details of this structure.
COA and COD reports are not generated for messages that have a Format of MQFMT_XMIT_Q_HEADER.
For the C programming language, the constant MQFMT_XMIT_Q_HEADER_ARRAY is also defined; this has the same value as MQFMT_XMIT_Q_HEADER, but is an array of characters instead of a string.
This is an output field for the MQGET call, and an input field for the MQPUT and MQPUT1 calls. The length of this field is given by MQ_FORMAT_LENGTH. The initial value of this field is MQFMT_NONE.
Parent topic: Fields for MQMD