_______________________________________________________________________________

                     Administration Task Using Commands:
-------------------------------------------------------------------------------
 1.Control Commands
 2.MQSC Comands
 3.PCF Commands

I) Control Commands:
   -----------------
            1.Queue manager commands : Creating,Starting ,stopping and deleting
                                       Q Managers.
            2.Channel commands :Commands for starting and ending channels and
                                channel initiators.
            3.Utility commands :Commands associated with
                                *Running MQSC commands.
                                *Trigger Monitors.
                                *Conversion Exits.
II) MQSC COmmands:
    -------------
            To Start We Use: runmqsc QMNAME 
            Examples       :
                          1.DISPLAY QNAME(QUEUE1) CURDEPTH
                          2.ALTER CHANNEL(channel-name) CHLTYPE(sdr)
                          3.DEFINE QUEUE(queue-name)
                          4.DEFINE QMODEL(queue-name)

III)PCF commands :
    -------------
    The purpose of WebSphere MQ programmable command format (PCF) commands is to allow administration tasks to be programmed into an administration program. In this way you can create queues, process definitions, channels, and namelists, and change queue managers, from a program.

     Each PCF command is a data structure that is embedded in the application data part of a WebSphere MQ message. Each command is sent to the target queue manager using the MQI function MQPUT in the same way as any other message. The command server on the queue manager receiving the message interprets it as a command message and runs the command. To get the replies, the application issues an MQGET call and the reply data is returned in another data structure. The application can then process the reply and act accordingly.

** Note: Unlike MQSC commands, PCF commands and their replies are not in a text format that you can read. 


Briefly, these are some of the things needed to create a PCF command message:


A)Message descriptor
   __This is a standard WebSphere MQ message descriptor, in which:
   __Message type (MsqType) is MQMT_REQUEST.
   __Message format (Format) is MQFMT_ADMIN.

B)Application data
   __Contains the PCF message including the PCF header, in which:
   __The PCF message type (Type) specifies MQCFT_COMMAND.
   __The command identifier specifies the command, for example, Change Queue
      (MQCMD_CHANGE_Q).

_______________________________________________________________________________
             More On PCF (Programmable Command Format)
------------------------------------------------------------------------------

PCF command messages
Each command and its parameters are sent as a separate command message containing a PCF header followed by a number of parameter structures (see MQCFH - PCF header). 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.

The queue to which the PCF commands are sent is always called the SYSTEM.ADMIN.COMMAND.QUEUE. 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 respective queues.

Note to users
You must start the command server on the target queue manager for the PCF command to process on that queue manager.
 


For a list of supplied header files, see Appendix C, Header, COPY, and INCLUDE files.


Message descriptor for a PCF command
The WebSphere MQ message descriptor is fully documented in the WebSphere MQ Application Programming Reference manual.

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


Report
Any valid value, as required.

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

Expiry
Any valid value, as required.

Feedback
Set to MQFB_NONE

Encoding
If you are sending to iSeries, OS/2(R), Windows NT, Windows 2000 or UNIX systems, set this field to the encoding used for the message data; conversion will be performed if necessary.


CodedCharSetId
If you are sending to iSeries, OS/2, Windows NT, Windows 2000, or UNIX systems, set this field to the coded character-set identifier used for the message data; conversion will be performed if necessary.

Format
Set to MQFMT_ADMIN.

Priority
Any valid value, as required.

Persistence
Any valid value, as required.

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

CorrelId
The sending application may 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 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 you are using a version-2 MQMD structure, you 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

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