Use MQSC commands interactively
We can use MQSC commands interactively by using a command window or shell.
To use MQSC commands interactively, open a command window or shell and enter:runmqscIn this command, a queue manager name has not been specified, so the MQSC commands are processed by the default queue manager. If you want to use a different queue manager, specify the queue manager name on the runmqsc command. For example, to run MQSC commands on queue manager jupiter.queue.manager, use the command:runmqsc jupiter.queue.managerAfter this, all the MQSC commands you type in are processed by this queue manager, assuming that it is on the same node and is already running.
Now we can type in any MQSC commands, as required. For example, try this one: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 (;). (This is especially useful if you accidentally enter a continuation character at the end of the final line of command input.)
Feedback from MQSC commands
When you issue MQSC commands, the queue manager returns operator messages that confirm your actions or tell you about the errors we have made. For example:AMQ8006: IBM MQ queue created.This message confirms that a queue has been 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 : endThis message indicates that we have made a syntax error.
These messages are sent to the standard output device. If we have not entered the command correctly, refer to MQSC commands for the correct syntax.
Ending interactive input of MQSC commands
To stop working with MQSC commands, enter the END command.
Alternatively, we can use the EOF character for your operating system.