Running MQSC commands interactively

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


About this task

We can set the prompt that is displayed when you run the runmqsc command. For more information, see Running MQSC commands interactively.

When you run MQSC commands interactively on UNIX platforms, the runmqsc command line supports command recall, command completion, and Emacs command keys. For more information, see The runmqsc command on UNIX.


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 we want to process the MQSC commands. We 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. We can also terminate command input explicitly by entering a semicolon (;).

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

    Alternatively, we can use the EOF character for the operating system.


Results

When we 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 we 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 we have not entered the command correctly, refer to the reference information for the command to find the correct syntax. See, MQSC commands.

Parent topic: Administration using MQSC commands


Related tasks


Related information