+

Search Tips | Advanced Search

PCF command messages

PCF command messages consist of a PCF header, parameters identified in that header and also user-defined message data. The messages are issued using Message Queue interface calls.

Each command and its parameters are sent as a separate command message containing a PCF header followed by a number of parameter structures; for details of the PCF header, see MQCFH - PCF header, and for an example of a parameter structure, see MQCFST - PCF string parameter. The PCF header identifies the command and the number of parameter structures that follow in the same message. Each parameter structure provides a parameter to the command.

Replies to the commands, generated by the command server, have a similar structure. There is a PCF header, followed by a number of parameter structures. Replies can consist of more than one message but commands always consist of one message only.

On Multiplatforms, the queue to which the PCF commands are sent is always called the SYSTEM.ADMIN.COMMAND.QUEUE.

On z/OS, commands are sent to SYSTEM.COMMAND.INPUT, although SYSTEM.ADMIN.COMMAND.QUEUE can be an alias for it. The command server servicing this queue sends the replies to the queue defined by the ReplyToQ and ReplyToQMgr fields in the message descriptor of the command message.


How to issue PCF command messages

Use the normal Message Queue Interface (MQI) calls, MQPUT, MQGET, and so on, to put and retrieve PCF command and response messages to and from their queues.

Note:

Ensure that the command server is running on the target queue manager for the PCF command to process on that queue manager.

For a list of supplied header files, see IBM MQ COPY, header, include and module files.


Message descriptor for a PCF command

The IBM MQ message descriptor is fully documented in MQMD - Message descriptor.

A PCF command message contains the following fields in the message descriptor:

    Report
    Any valid value, as required.

    MsgType
    This field must be MQMT_REQUEST to indicate a message requiring a response.

    Expiry
    Any valid value, as required.

    Feedback
    Set to MQFB_NONE

    Encoding
    If we are sending to one of the following systems, set this field to the encoding used for the message data; conversion is performed if necessary:

    • IBM i
    • Linux
    • UNIX
    • Windows

    CodedCharSetId
    If we are sending to one of the following systems, set this field to the coded character-set identifier used for the message data; conversion is performed if necessary:

    • IBM i
    • Linux
    • UNIX
    • Windows

    Format
    Set to MQFMT_ADMIN.

    Priority
    Any valid value, as required.

    Persistence
    Any valid value, as required.

    MsgId
    The sending application can specify any value, or MQMI_NONE can be specified to request the queue manager to generate a unique message identifier.

    CorrelId
    The sending application can specify any value, or MQCI_NONE can be specified to indicate no correlation identifier.

    ReplyToQ
    The name of the queue to receive the response.

    ReplyToQMgr
    The name of the queue manager for the response (or blank).

    Message context fields
    These fields can be set to any valid values, as required. Normally the Put message option MQPMO_DEFAULT_CONTEXT is used to set the message context fields to the default values.

If we are using a version-2 MQMD structure, we must set the following additional fields:

    GroupId
    Set to MQGI_NONE

    MsgSeqNumber
    Set to 1

    Offset
    Set to 0

    MsgFlags
    Set to MQMF_NONE

    OriginalLength
    Set to MQOL_UNDEFINED


Send user data

The PCF structures can also be used to send user-defined message data. In this case the message descriptor Format field must be set to MQFMT_PCF.

Parent topic: Use IBM MQ Programmable Command Formats

Last updated: 2020-10-04