Running MQSC commands interactively under runmqsc
On AIX®, Linux®, and Windows, you can use the runmqsc command prompt to issue MQSC commands to a queue manager interactively. Interactive running is particularly suitable for quick tests.
Before you begin
You must use the runmqsc command from the installation associated with the
queue manager that you are working with. You can find out which installation a queue manager is
associated with by using the dspmq -o installation command.
You 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 using the MQPROMPT environment variable. For more information, see Setting the MQSC command prompt.
![[AIX]](ngaix.gif)
When you run MQSC commands interactively on AIX and Linux platforms, the runmqsc command
prompt also supports additional command line editor functions. See Enabling command recall and completion, and Emacs command keys, for runmqsc.
About this task
The runmqsc command is used to open a command prompt from which you can issue MQSC commands. These commands and their syntax are described in the MQSC commands reference.
- Verification mode, where the MQSC commands are verified on a local queue manager, but are not run.
- Direct mode, where the MQSC commands are run on a local queue manager.
- Indirect mode, where the MQSC commands are run on a remote queue manager.
The procedure below sets the prompt to run in direct mode. Other options are illustrated in the examples that follow the main steps.
Procedure
Results
AMQ8006: IBM MQ queue created.
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, which by default is the display. If you have not entered the command correctly, refer to the reference information for the command to find the correct syntax. See MQSC commands reference.
Example
runmqsc QMgrName command
that is used in the previous steps. These variants create different configurations of the
runmqsc command prompt.- The following command uses command filtering to pass a single MQSC command to the MQSC
interpreter.
On Windows:echo display chstatus(*) | runmqsc QMname
On Linux:echo "display chstatus(*)" | runmqsc QMname - The following command does not specify a queue manager name, so the MQSC commands are processed
on the default queue manager.
runmqsc - This command submits commands to the QMREMOTE queue manager, using QMLOCAL to submit the
commands.
runmqsc -w 30 -m QMLOCAL QMREMOTE - This command verifies that the
command syntax is correct on a local queue manager without running the commands. Note that the
commands to be verified are read from an input file
myprog.in.
For more information about working with input and output files, see Running MQSC commands from text files under runmqsc.runmqsc -f myprog.in -v QmgrName