We have moved to www.dataGenX.net, Keep Learning with us.

Friday, May 24, 2013

Issuing commands to a Queue Manager (runmqsc)



Once we have created a Queue Manager, we will want to perform administrative tasks, such as creating queues, among others. To enable us to communicate with our Queue Manager, we use the RUNMQSC MQ command, which opens the MQSC (MQ Script Center) environment.

After entering the MQSC environment, we can issue one of the following MQSC commands: ALTER, CLEAR, DEFINE, DELETE, DISPLAY, END, PING, REFRESH, RESET, RESOLVE, RESUME, START, STOP, or SUSPEND. Each of these commands has it's own options, which are shown in the following table:


ALTER
CLEAR
DEFINE
DELETE
DISPLAY
END
PING
AUTHINFO
CHANNEL
PROCESS
NAMELIST
QALIAS
QLOCAL
QMGR
QMODEL
QREMOTE
SERVICE
LISTENER
QLOCAL
AUTHINFO
CHANNEL
PROCESS
NAMELIST
QALIAS
QLOCAL
QMODEL
QREMOTE
SERVICE
LISTENER
AUTHINFO
CHANNEL
PROCESS
NAMELIST
QALIAS
QLOCAL
QMODEL
QREMOTE
SERVICE
LISTENER
AUTHINFO QREMOTE
CHANNEL QUEUE
CHSTATUS QSTATUS
CLUSQMGR CONN
PROCESS SERVICE
NAMELIST LISTENER
QALIAS SVSTATUS
QCLUSTER LSSTATUS
QLOCAL QMSTATUS
QMGR
QMODEL

CHANNEL
QMGR

REFRESH
RESET
RESOLVE
RESUME
START
STOP
SUSPEND
CLUSTER
SECURITY
CHANNEL
CLUSTER
QMGR
CHANNEL
QMGR CLUSTER
QMGR CLUSNL
CHANNEL
CHINIT
LISTENER
SERVICE
CHANNEL
LISTENER
SERVICE
CONN
QMGR CLUSTER
QMGR CLUSNL


We can either enter the these MQSC commands interactively or pipe the commands into the MQSC environment.

To invoke the MQSC environment for Queue Manager QMA, issue the RUNQMSC command as follows:

$ runmqsc QMA
You should see something similar to the following on your screen:
5724-H72 (C) Copyright IBM Corp. 1994, 2004. ALL RIGHTS RESERVED.
Starting MQSC for queue manager QMA.

And then enter the command we want. For example, to defne a Local Queue called CAPA.ADMINQ, we would enter:


DEFINE QLOCAL(CAPA.ADMINQ) REPLACE PUT(ENABLED)
GET(ENABLED) SHARE DEFSOPT(SHARED) DEFPSIST(YES)

      1 : DEFINE QLOCAL(CAPA.ADMINQ) REPLACE PUT(ENABLED)
GET(ENABLED) SHARE DEFSOPT(SHARED) DEFPSIST(YES)
AMQ8006: WebSphere MQ queue created.
end
      2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
Note that the end command exits the MQSC environment.


Alternatively, and more usually, we can create a text fle containing the commands to execute, and then pipe this text fle into the MQSC environment:
 
$ runmqsc QMA < <input-text-file>


For example, to run the commands in the create_qlocal.txt text fle, we would type:


$ runmqsc QMA < create_qlocal.txt
And you'll see this on your screen:
5724-H72 (C) Copyright IBM Corp. 1994, 2004. ALL RIGHTS RESERVED.
Starting MQSC for queue manager QMA.
    1 : DEFINE QLOCAL(CAPA.ADMINQ) +
       : REPLACE +
       : PUT(ENABLED) +
       : GET(ENABLED) +
       : SHARE +
       : DEFSOPT(SHARED) +
       : DEFPSIST(YES)
AMQ8006: WebSphere MQ queue created.
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.


Comment lines in the MQSC text fle start with an asterisk (*) symbol.
The line continuation character is the plus (+) symbol.