+

Search Tips | Advanced Search

Administer MQ by using MQSC commands

How to use MQSC commands to complete common tasks.

MQSC commands are available on all platforms, including IBM® i, and z/OS®.

We can use MQSC commands to manage queue manager objects, including the queue manager itself, queues, process definitions, channels, client connection channels, listeners, services, namelists, clusters, and authentication information objects. This section deals with queue managers, queues, and process definitions; for an overview of channel, client connection channel, and listener objects, see Objects. For information about all the MQSC commands for managing queue manager objects, see Script (MQSC) commands.

You issue MQSC commands to a queue manager using the runmqsc command. (For details of this command, see runmqsc.) We can do this interactively, issuing commands from a keyboard, or we can redirect the standard input device ( stdin) to run a sequence of commands from an ASCII text file. In both cases, the format of the commands is the same. (For information about running the commands from a text file, see Running MQSC commands from text files.)

We can run the runmqsc command in three ways, depending on the flags set on the command:

We can also run the command followed by a question mark to display the syntax.

Object attributes specified in MQSC commands are shown in this section in uppercase (for example, RQMNAME), although they are not case-sensitive. MQSC command attribute names are limited to eight characters.

For Continuous Delivery, from IBM MQ Version 9.0.1, we can set a prompt of your choice by using the MQPROMPT environment variable. In addition to plain text, the MQPROMPT variable also allows environment variables to be inserted, by using +VARNAME+ notation, in the same manner as IBM MQ service object definitions (see Defining a service object). For example:
sh> export MQPROMPT="+USER+ @ +QMNAME+ @ +MQ_HOST_NAME+> "
sh> runmqsc MY.QMGR
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting MQSC for queue manager MY.QMGR.
username @ MY.QMGR @ aix1> DISPLAY QMSTATUS

From IBM MQ Version 9.0.0, Fix Pack 1, the MQPROMPT environment variable is also available in the Long Term Support release.

MQSC commands are detailed in the MQSC commands section.

On Windows or Linux (x86 and x86-64 platforms), we can also perform the operations described in this section using the IBM MQ Explorer. For more information, see Administration using the IBM MQ Explorer.