Home

 

Fields

StrucId (MQCHAR4)

Structure identifier.

The value must be:

MQRFH_STRUC_ID

Identifier for rules and formatting header structure.

For the C programming language, the constant MQRFH_STRUC_ID_ARRAY is also defined; this has the same value as MQRFH_STRUC_ID, but is an array of characters instead of a string.

The initial value of this field is MQRFH_STRUC_ID.

V(MQLONG)

Structure version number.

The value must be:

MQRFH_VERSION_1

Version-1 rules and formatting header structure.

The initial value of this field is MQRFH_VERSION_1.

StrucLength (MQLONG)

Total length of MQRFH including string containing name/value pairs.

This is the length in bytes of the MQRFH structure, including the NameValueString field at the end of the structure. The length does not include any user data that follows the NameValueString field.

To avoid problems with data conversion of the user data in some environments, make sure that StrucLength is a multiple of four.

The following constant gives the length of the fixed part of the structure, that is, the length excluding the NameValueString field:

MQRFH_STRUC_LENGTH_FIXED

Length of fixed part of MQRFH structure.

The initial value of this field is MQRFH_STRUC_LENGTH_FIXED.

Encoding (MQLONG)

Numeric encoding.

This specifies the representation used for numeric values in the user data (if any) that follows the string containing the name/value pairs. This applies to binary integer data, packed-decimal integer data, and floating-point data.

The initial value of this field is MQENC_NATIVE.

CodedCharSetId (MQLONG)

Coded character set identifier.

This specifies the coded character set identifier of character strings in the user data (if any) that follows the string containing the name/value pairs.

Note:
When a message is put, this field must be set to the nonzero value that specifies the character set of the user data. If this is not done, it is not possible to convert the message using the MQGMO_CONVERT option when the message is retrieved.

The initial value of this field is0.

Format (MQCHAR8)

Format name.

This specifies the format name of the user data (if any) that follows the string containing the name/value pairs.

Pad the name with blanks to the length of the field. Do not use a null character to terminate the name before the end of the field, because the queue manager does not change the null and subsequent characters to blanks in the MQRFH structure. Do not specify a name with leading or embedded blanks.

The initial value of this field is MQFMT_NONE.

Flags (MQLONG)

Flags.

The following can be specified:

MQRFH_NONE

No flags.

The initial value of this field is MQRFH_NONE.

NameValueString (MQCHARn)

String containing name/value pairs.

This is a variable-length character string containing name/value pairs in the form:

name1 value1 name2 value2 name3 value3 ...

Each name or value must be separated from the adjacent name or value by one or more blank characters; these blanks are not significant. A name or value can contain significant blanks by prefixing and suffixing the name or value with the double-quote character; all characters between the open double-quote and the matching close double-quote are treated as significant. In the following example, the name isFAMOUS_WORDS, and the value is Hello World:

FAMOUS_WORDS "Hello World"

A name or value can contain any characters other than the null character (which acts as a delimiter for NameValueString). However, to assist interoperability, an application might prefer to restrict names to the following characters:

  • First character: upper case or lower case alphabetic (

    A through Z, or a through z), or underscore.

  • Second character: upper case or lower case alphabetic, decimal digit (

    0 through 9), underscore, hyphen, or dot.

If a name or value contains one or more double-quote characters, the name or value must be enclosed in double quotes, and each double quote within the string must be doubled, for example:

Famous_Words "The program displayed ""Hello World"""

Names and values are case sensitive, that is, lowercase letters are not considered to be the same as uppercase letters. For example,FAMOUS_WORDS and Famous_Words are two different names.

The length in bytes of NameValueString is equal to StrucLength minus MQRFH_STRUC_LENGTH_FIXED. To avoid problems with data conversion of the user data in some environments, make sure that this length is a multiple of four. NameValueString must be padded with blanks to this length, or terminated earlier by placing a null character following the last value in the string. The null and bytes following it, up to the specified length of NameValueString, are ignored.

Note:
Because the contents and length of the NameValueString field are not fixed, no initial value is given for this field, and it is omitted from the Structure definition in C.
Table 2. Initial values of fields in MQRFH
Field name Name of constant Value of constant
StrucId MQRFH_STRUC_ID

'RFH '
(See note 1)

Version MQRFH_VERSION_1

1

StrucLength MQRFH_STRUC_LENGTH_FIXED

32

Encoding MQENC_NATIVE See note 2
CodedCharSetId None

0

Format MQFMT_NONE

'        '

Flags MQRFH_NONE

0

Notes:

  1. The symbol ' ' represents a single blank character.

  2. The value of this constant is environment-specific.

  3. In the C programming language, the macro variable MQRFH_DEFAULT contains the values listed above. It can be used in the following way to provide initial values for the fields in the structure:

    MQRFH MyRFH = {MQRFH_DEFAULT};



 

Home