Performing local administration tasks using MQSC commands

This section introduces you to MQSC commands and tells you how to use them for some common tasks.

If you use IBM® MQ for Windows or IBM MQ for Linux® (x86 and x86-64 platforms), you can also perform the operations described in this section using the IBM MQ Explorer. See Administration using the MQ Explorer for more information.

You 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.) You can do this interactively, issuing commands from a keyboard, or you 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.)

You can run the runmqsc command in three ways, depending on the flags set on the command:
  • Verify a command without running it, where the MQSC commands are verified on a local queue manager, but are not run.
  • Run a command on a local queue manager, where the MQSC commands are run on a local queue manager.
  • Run a command on a remote queue manager, where the MQSC commands are run on a remote queue manager.

You 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. MQSC commands are available on other platforms, including IBM i and z/OS®.

From IBM MQ 8.0, you 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, 2024.
Starting MQSC for queue manager MY.QMGR.
username @ MY.QMGR @ aix1> DISPLAY QMSTATUS

MQSC commands are detailed in the MQSC commands section.