runmqsc (run MQSC commands)
Purpose
Use the runmqsc command to issue MQSC commands to a queue manager. MQSC commands enable you to perform administration tasks, for example defining, altering, or deleting a local queue object. MQSC commands and their syntax are described in the WebSphere MQ Script (MQSC) Command Reference.
Syntax
.---------------------------. V | >>-runmqsc----+-----------------------+-+--+----------+-------->< +- -e ------------------+ '-queue_manager-' +- -v ------------------+ '- -w WaitTime-+------+-' '- -x -'
Overview
You can invoke the runmqsc command in three ways:
- Verify command
- Verify MQSC commands but do not run them. An output report is generated indicating the success or failure of each command. This mode is available on a local queue manager only.
- Run command directly
- Send MQSC commands directly to a local queue manager.
- Run command indirectly
- Run MQSC commands on a remote queue manager. These commands are put on the command queue on a remote queue manager and run in the order in which they were queued. Reports from the commands are returned to the local queue manager.
Indirect mode operation is performed through the default queue manager.
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, you can enter MQSC commands interactively.
By redirecting the input from a file, you can run a sequence of frequently-used commands contained in the file. You can also redirect the output report to a file.
Optional parameters
- -e
- Prevents source text for the MQSC commands from being copied into a report. This is useful when you enter commands interactively.
- -v
- Verifies the specified commands without performing the actions. This mode is only available locally. The -w and -x flags are ignored if they are specified at the same time.
- -w WaitTime
- Run the MQSC commands on another queue manager. You must have the required channel and transmission queues set up for this. See Preparing channels and transmission queues for remote administration for more information.
- WaitTime
- The time, in seconds, that runmqsc waits for replies. Any replies received after this are discarded, but the MQSC commands still run. Specify a time between 1 and 999 999 seconds.
Each command is sent as an Escape PCF to the command queue (SYSTEM.ADMIN.COMMAND.QUEUE) of the target queue manager.
The replies are received on queue SYSTEM.MQSC.REPLY.QUEUE and the outcome is added to the report. This can be defined as either a local queue or a model queue.
Indirect mode operation is performed through the default queue manager.
This flag is ignored if the -v flag is specified.
- -x
- The target queue manager is running under z/OS. This flag applies only in indirect mode. The -w flag must also be specified. In indirect mode, the MQSC commands are written in a form suitable for the WebSphere MQ for z/OS command queue.
- queue_manager
- The name of the target queue manager on which to run the MQSC commands, by default, the default queue manager.
Return codes
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
- Enter this command at the command prompt:
Now you 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.runmqsc- Use one of these commands, as appropriate in your environment, to specify that MQSC commands are to be verified only:
This command verifies the MQSC commands in file commfile.in. The queue manager name is BANK. The output is displayed in the current window.runmqsc -v BANK < "/u/users/commfile.in" runmqsc -v BANK < "c:\users\commfile.in"- These commands run the MQSC command file mqscfile.in against the default queue manager.
In this example, the output is directed to file mqscfile.out.runmqsc < "/var/mqm/mqsc/mqscfile.in" > "/var/mqm/mqsc/mqscfile.out" runmqsc < "c:\Program Files\IBM\WebSphere MQ\mqsc\mqscfile.in" > "c:\Program Files\IBM\WebSphere MQ\mqsc\mqscfile.out"
WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.
IBM is a trademark of the IBM Corporation in the United States, other countries, or both.