+

Search Tips | Advanced Search

runmqsc (run MQSC commands)

Run IBM MQ commands on a queue manager.


Purpose

Use the runmqsc command to issue MQSC commands to a queue manager. MQSC commands enable you to perform administration tasks. For example, we can define, alter, or delete a local queue object. MQSC commands and their syntax are described in MQSC commands.

You must use the runmqsc command from the installation associated with the queue manager that you are working with. We can find out which installation a queue manager is associated with by using the dspmq -o installation command.

To stop the runmqsc command, use the end command. We can also use the exit or the quit command.

For Continuous Delivery, from IBM MQ Version 9.0.1, we can make it easier to see that you are in an MQSC environment and see some details of the current environment by setting a prompt of your choice by using the MQPROMPT environment variable. For more information, see Administration using MQSC commands.

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


Syntax

We can use the -n parameter on its own, or we can use a number of other parameters in combination:

runmqsc   -n

runmqsc   -e   -v   -c   -u UserID   -w WaitTime  -x -mDefaultQMgrName-mLocalQMgrNameQMgrName


Description

We can start the runmqsc command in three ways:

The runmqsc command takes its input from stdin. When the commands are processed, the results and a summary are put into a report that is sent to stdout.

By taking stdin from the keyboard, we can enter MQSC commands interactively.

Alternatively, we can redirect stdin from a text file. By redirecting the input from a file, we can run a sequence of frequently used commands contained in the file. We can also redirect the output report to a file.Note: If you run runmqsc in client mode by redirecting stdin from a text file, IBM MQ expects the first line of the input file to be a password.


Optional parameters


Return codes

Return code Description
00 MQSC command file processed successfully
10 MQSC command file processed with errors; report contains reasons for failing commands
20 Error; MQSC command file not run


Examples

  1. Enter this command at a command prompt:
    runmqsc
    
    Now we can enter MQSC commands directly at the command prompt. No queue manager name is specified, so the MQSC commands are processed on the default queue manager.
  2. Use one of these commands, as appropriate in your environment, to specify that MQSC commands are to be verified only:
    runmqsc -v BANK < "/u/users/commfile.in"
    
    runmqsc -v BANK < "c:\users\commfile.in"
    
    The queue manager name is BANK. The command verifies the MQSC commands in file commfile.in and displays the output in the current window.
  3. These commands run the MQSC command file mqscfile.in against the default queue manager.
    runmqsc < "/var/mqm/mqsc/mqscfile.in" > "/var/mqm/mqsc/mqscfile.out"
    
    runmqsc < "C:\Program Files\IBM\MQ\mqsc\mqscfile.in" >
            "C:\Program Files\IBM\MQ\mqsc\mqscfile.out"
    
    In this example, the output is directed to file mqscfile.out.
  4. This command submits commands to the QMREMOTE queue manager, using QMLOCAL to submit the commands.
    runmqsc -w 30 -m QMLOCAL QMREMOTE