MQCFH - PCF header

The MQCFH PCF structure describes the information that is present at the start of the message data of a command message, or a response to a command message. In either case, the message descriptor Format field is MQFMT_ADMIN.

The PCF structures are also used for event messages. In this case the message descriptor Format field is MQFMT_EVENT.

The PCF structures can also be used for user-defined message data. In this case the message descriptor Format field is MQFMT_PCF (see Message descriptor for a PCF command ). Also in this case, not all the fields in the structure are meaningful. The supplied initial values can be used for most fields, but the application must set the StrucLength and ParameterCount fields to the values appropriate to the data.

Fields for MQCFH

Structure type.
This field indicates the content of the message. The following values are valid for commands:
Message is a command.
Message is a command to which standard or extended responses might be sent.

This value is required on z/OS®.

Message is a response to a command.
Message is an extended response to a command. It contains informational or error details.
Message is an extended response to an Inquire command. It contains item data.
Message is an extended response to a command. It contains summary information.
User-defined PCF message.
StrucLength (MQLONG)
Structure length.
This field is the length in bytes of the MQCFH structure. The value must be:
Length of command format header structure.
Version (MQLONG)
Structure version number.
For z/OS, the value must be:
Version number for command format header structure.
The following constant specifies the version number of the current version:
Current version of command format header structure.
Command (MQLONG)
Command identifier.

For a command message, this field identifies the function to be performed. For a response message, it identifies the command to which this field is the reply. See the description of each command for the value of this field.

MsgSeqNumber (MQLONG)
Message sequence number.

This field is the sequence number of the message within a set of related messages. For a command, this field must have the value one (because a command is always contained within a single message). For a response, the field has the value one for the first (or only) response to a command, and increases by one for each successive response to that command.

The last (or only) message in a set has the MQCFC_LAST flag set in the Control field.

Control (MQLONG)
Control options.
The following values are valid:
Last message in the set.

For a command, this value must always be set.

Not the last message in the set.
CompCode (MQLONG)
Completion code.
This field is meaningful only for a response; its value is not significant for a command. The following values are possible:
Command completed successfully.
Command completed with warning.
Command failed.
Whether command succeeded is not known.
Reason (MQLONG)
Reason code qualifying completion code.

This field is meaningful only for a response; its value is not significant for a command.

The possible reason codes that can be returned in response to a command are listed in, Definitions of the Programmable Command Formats and in the description of each command.

ParameterCount (MQLONG)
Count of parameter structures.

This field is the number of parameter structures (MQCFBF, MQCFBS, MQCFIF, MQCFIL, MQCFIN, MQCFSL, MQCFSF, and MQCFST) that follow the MQCFH structure. The value of this field is zero or greater.

C language declaration

typedef struct tagMQCFH {
  MQLONG  Type;            /* Structure type */
  MQLONG  StrucLength;     /* Structure length */
  MQLONG  Version;         /* Structure version number */
  MQLONG  Command;         /* Command identifier */
  MQLONG  MsgSeqNumber;    /* Message sequence number */
  MQLONG  Control;         /* Control options */
  MQLONG  CompCode;        /* Completion code */
  MQLONG  Reason;          /* Reason code qualifying completion code */
  MQLONG  ParameterCount;  /* Count of parameter structures */

COBOL language declaration

**   MQCFH structure
  10 MQCFH.
**    Structure type
   15 MQCFH-TYPE           PIC S9(9) BINARY.
**    Structure length
**    Structure version number
   15 MQCFH-VERSION        PIC S9(9) BINARY.
**    Command identifier
   15 MQCFH-COMMAND        PIC S9(9) BINARY.
**    Message sequence number
**    Control options
   15 MQCFH-CONTROL        PIC S9(9) BINARY.
**    Completion code
**    Reason code qualifying completion code
   15 MQCFH-REASON         PIC S9(9) BINARY.
**    Count of parameter structures

PL/I language declaration ( z/OS only)

 1 MQCFH based,
  3 Type           fixed bin(31), /* Structure type */
  3 StrucLength    fixed bin(31), /* Structure length */
  3 Version        fixed bin(31), /* Structure version number */
  3 Command        fixed bin(31), /* Command identifier */
  3 MsgSeqNumber   fixed bin(31), /* Message sequence number */
  3 Control        fixed bin(31), /* Control options */
  3 CompCode       fixed bin(31), /* Completion code */
  3 Reason         fixed bin(31), /* Reason code qualifying completion
                                     code */
  3 ParameterCount fixed bin(31); /* Count of parameter structures */

System/390 assembler-language declaration ( z/OS only)

MQCFH                          DSECT
MQCFH_TYPE                     DS   F        Structure type
MQCFH_STRUCLENGTH              DS   F        Structure length
MQCFH_VERSION                  DS   F        Structure version number
MQCFH_COMMAND                  DS   F        Command identifier
MQCFH_MSGSEQNUMBER             DS   F        Message sequence number
MQCFH_CONTROL                  DS   F        Control options
MQCFH_COMPCODE                 DS   F        Completion code
MQCFH_REASON                   DS   F        Reason code qualifying
*                                            completion code
MQCFH_PARAMETERCOUNT           DS   F        Count of parameter
*                                            structures
MQCFH_LENGTH                   EQU  *-MQCFH  Length of structure
                               ORG  MQCFH
MQCFH_AREA                     DS   CL(MQCFH_LENGTH)

Visual Basic language declaration ( Windows only)

  Type As Long            'Structure type
  StrucLength As Long     'Structure length
  Version As Long         'Structure version number
  Command As Long         'Command identifier
  MsgSeqNumber As Long    'Message sequence number
  Control As Long         'Control options
  CompCode As Long        'Completion code
  Reason As Long          'Reason code qualifying completion code
  ParameterCount As Long  'Count of parameter structures
End Type


RPG language declaration ( IBM® i only)

D* MQCFH Structure
D* Structure type
D  FHTYP                  1      4I 0 INZ(1)
D* Structure length
D  FHLEN                  5      8I 0 INZ(36)
D* Structure version number
D  FHVER                  9     12I 0 INZ(1)
D* Command identifier
D  FHCMD                 13     16I 0 INZ(0)
D* Message sequence number
D  FHSEQ                 17     20I 0 INZ(1)
D* Control options
D  FHCTL                 21     24I 0 INZ(1)
D* Completion code
D  FHCMP                 25     28I 0 INZ(0)
D* Reason code qualifying completion code
D  FHREA                 29     32I 0 INZ(0)
D* Count of parameter structures
D  FHCNT                 33     36I 0 INZ(0)