Running MQSC commands interactively

You can use MQSC commands interactively by using a command window or shell.

Before you begin

You can set the prompt that is displayed when you run the runmqsc command. See Setting the MQSC command prompt.

[UNIX][Linux]When you run MQSC commands interactively on UNIX and Linux® platforms, the runmqsc command line supports command recall, command completion, and Emacs command keys. See The runmqsc command on UNIX and Linux.

About this task

Procedure

  1. To use MQSC commands interactively, open a command window or shell and enter the following command:
    
    runmqsc QMgrName
    
    Where QMgrName specifies the name of the queue manager that you want to process the MQSC commands. You can leave QMgrName blank to process MQSC commands on the default queue manager.
  2. Type in any MQSC commands, as required. For example, to create a local queue called ORANGE.LOCAL.QUEUE enter the following command:
    
    DEFINE QLOCAL (ORANGE.LOCAL.QUEUE)
    
    For commands that have too many parameters to fit on one line, use continuation characters to indicate that a command is continued on the following line:
    • A minus sign (-) indicates that the command is to be continued from the start of the following line.
    • A plus sign (+) indicates that the command is to be continued from the first nonblank character on the following line.

    Command input terminates with the final character of a nonblank line that is not a continuation character. You can also terminate command input explicitly by entering a semicolon (;).

  3. Stop working with MQSC commands by entering the following command:
    end

    Alternatively, you can use the EOF character for your operating system.

Results

When you issue MQSC commands, the queue manager returns operator messages that confirm your actions or tell you about the errors you have made. For example, the following message confirms a queue is created:

AMQ8006: IBM MQ queue created.
The following message indicates that you have made a syntax error:

AMQ8405: Syntax error detected at or near end of command segment below:-
AMQ8426: Valid MQSC commands are:

ALTER
CLEAR
DEFINE
DELETE
DISPLAY
END
PING
REFRESH
RESET
RESOLVE
RESUME
START
STOP
SUSPEND
4 : end

These messages are sent to the standard output device. If you have not entered the command correctly, refer to the reference information for the command to find the correct syntax. See, MQSC commands.