MQRFH2 - Rules and formatting header 2

The MQRFH2 header is based on the MQRFH header, but it allows Unicode strings to be transported without translation, and it can carry numeric data types. The MQRFH2 structure defines the format of the version-2 rules and formatting header. You use this header to send data that has been encoded using an XML-like syntax. A message can contain two or more MQRFH2 structures in series, with user data optionally following the last MQRFH2 structure in the series.

Availability

All IBM® MQ systems, plus IBM MQ MQI clients connected to these systems.

Format name

MQFMT_RF_HEADER_2

Syntax

IBM MQ Message

Read syntax diagramSkip visual syntax diagramMQRFH2 headerChainableHeaderUnformatted dataString dataFormatted dataUnchainable header
MQRFH2 header
Read syntax diagramSkip visual syntax diagram Standard part Special part NameValueLengthNameValueData
Standard part
Read syntax diagramSkip visual syntax diagram RFH¬ 2Version 36StructLength MQENC_NATIVEEncoding -2CodedCharSetId ¬¬¬¬¬¬S¬¬Format
Special part
Read syntax diagramSkip visual syntax diagram 0Flags 120812001348817584

Character set and encoding

Special rules apply to the character set and encoding used for the MQRFH2 structure:
  • Fields other than NameValueData are in the character set and encoding given by the CodedCharSetId and Encoding fields in the header structure that precedes MQRFH2, or by those fields in the MQMD structure if the MQRFH2 is at the start of the application message data.

    The character set must be one that has single-byte characters for the characters that are valid in queue names.

    When MQGMO_CONVERT is specified on the MQGET call, the queue manager converts the MQRFH2 fields, other than NameValueData, to the requested character set and encoding.

  • NameValueData is in the character set given by the NameValueCCSID field. Only the listed Unicode character sets are valid for NameValueCCSID ; see the description of NameValueCCSID for details.

    Some character sets have a representation that depends on the encoding. If NameValueCCSID is one of these character sets, NameValueData must be in the same encoding as the other fields in the MQRFH2.

    When MQGMO_CONVERT is specified on the MQGET call, the queue manager converts NameValueData to the requested encoding, but does not change its character set.

Fields

Note: In the following table, the fields are grouped by usage rather than alphabetically. The child topics follow the same sequence.
Table 1. Fields in MQRFH2 for MQRFH2
Field name Name of constant Value of constant
StrucId (structure identifier) MQRFH_STRUC_ID 'RFH¬'
Version (structure version number) MQRFH_VERSION_2 2
StrucLength (length in bytes of the MQRFH2 structure) MQRFH_STRUC_LENGTH_FIXED_2 36
Encoding (numeric encoding of the data that follows the last NameValueData field) MQENC_NATIVE Depends on environment
CodedCharSetId (character set identifier of the data that follows the last NameValueData field) MQCCSI_INHERIT -2
Format (format name of the data that follows the last NameValueData field) MQFMT_NONE Blanks
Flags (flags) MQRFH_NONE 0
NameValueCCSID (coded character set identifier of the data in the NameValueData field) None 1208
NameValueLength (length in bytes of the data in the NameValueData field) None None
NameValueData (name-value pairs of message properties) None None
Notes:
  1. The symbol ¬ represents a single blank character.
  2. In the C programming language, the macro variable MQRFH2_DEFAULT contains the values that are listed in the table. Use it in the following way to provide initial values for the fields in the structure:
    
    MQRFH2 MyRFH2 = {MQRFH2_DEFAULT};
    

Language declarations

C declaration for MQRFH2


typedef struct tagMQRFH2 MQRFH2;
struct tagMQRFH2 {
  MQCHAR4  StrucId;         /* Structure identifier */
  MQLONG   Version;         /* Structure version number */
  MQLONG   StrucLength;     /* Total length of MQRFH2 including all
                               NameValueLength and NameValueData
                               fields */
  MQLONG   Encoding;        /* Numeric encoding of data that follows
                               last NameValueData field */
  MQLONG   CodedCharSetId;  /* Character set identifier of data that
                               follows last NameValueData field */
  MQCHAR8  Format;          /* Format name of data that follows last
                               NameValueData field */
  MQLONG   Flags;           /* Flags */
  MQLONG   NameValueCCSID;  /* Character set identifier of
                               NameValueData */
};

COBOL declaration for MQRFH2


**   MQRFH2 structure
  10 MQRFH2.
**    Structure identifier
   15 MQRFH2-STRUCID        PIC X(4).
**    Structure version number
   15 MQRFH2-VERSION        PIC S9(9) BINARY.
**    Total length of MQRFH2 including all NAMEVALUELENGTH and
**    NAMEVALUEDATA fields
   15 MQRFH2-STRUCLENGTH    PIC S9(9) BINARY.
**    Numeric encoding of data that follows last NAMEVALUEDATA field
   15 MQRFH2-ENCODING       PIC S9(9) BINARY.
**    Character set identifier of data that follows last NAMEVALUEDATA
**    field
   15 MQRFH2-CODEDCHARSETID PIC S9(9) BINARY.
**    Format name of data that follows last NAMEVALUEDATA field
   15 MQRFH2-FORMAT         PIC X(8).
**    Flags
   15 MQRFH2-FLAGS          PIC S9(9) BINARY.
**    Character set identifier of NAMEVALUEDATA
   15 MQRFH2-NAMEVALUECCSID PIC S9(9) BINARY.

PL/I declaration for MQRFH2


dcl
 1 MQRFH2 based,
  3 StrucId        char(4),       /* Structure identifier */
  3 Version        fixed bin(31), /* Structure version number */
  3 StrucLength    fixed bin(31), /* Total length of MQRFH2 including
                                     all NameValueLength and
                                     NameValueData fields */
  3 Encoding       fixed bin(31), /* Numeric encoding of data that
                                     follows last NameValueData field */
  3 CodedCharSetId fixed bin(31), /* Character set identifier of data
                                     that follows last NameValueData
                                     field */
  3 Format         char(8),       /* Format name of data that follows
                                     last NameValueData field */
  3 Flags          fixed bin(31), /* Flags */
  3 NameValueCCSID fixed bin(31); /* Character set identifier of
                                     NameValueData */

High Level Assembler declaration for MQRFH2


MQRFH                 DSECT
MQRFH_STRUCID         DS   CL4  Structure identifier
MQRFH_VERSION         DS   F    Structure version number
MQRFH_STRUCLENGTH     DS   F    Total length of MQRFH2 including all
*                               NAMEVALUELENGTH and NAMEVALUEDATA fields
MQRFH_ENCODING        DS   F    Numeric encoding of data that follows
*                               last NAMEVALUEDATA field
MQRFH_CODEDCHARSETID  DS   F    Character set identifier of data that
*                               follows last NAMEVALUEDATA field
MQRFH_FORMAT          DS   CL8  Format name of data that follows last
*                               NAMEVALUEDATA field
MQRFH_FLAGS           DS   F    Flags
MQRFH_NAMEVALUECCSID  DS   F    Character set identifier of
*                               NAMEVALUEDATA
*
MQRFH_LENGTH          EQU  *-MQRFH
                      ORG  MQRFH
MQRFH_AREA            DS   CL(MQRFH_LENGTH)

Visual Basic declaration for MQRFH2


Type MQRFH2
  StrucId        As String*4 'Structure identifier'
  Version        As Long     'Structure version number'
  StrucLength    As Long     'Total length of MQRFH2 including all'
                             'NameValueLength and NameValueData fields'
  Encoding       As Long     'Numeric encoding of data that follows'
                             'last NameValueData field'
  CodedCharSetId As Long     'Character set identifier of data that'
                             'follows last NameValueData field'
  Format         As String*8 'Format name of data that follows last'
                             'NameValueData field'
  Flags          As Long     'Flags'
  NameValueCCSID As Long     'Character set identifier of NameValueData'
End Type