Issuing MQSC commands on a remote queue manager
After you configure queue managers for remote administration, we can use a particular form of the runmqsc command on a local system to run MQSC commands on a remote queue manager. Each command is sent as an Escape PCF to the command queue, SYSTEM.ADMIN.COMMAND.QUEUE, of the remote queue manager. Replies are received on the SYSTEM.MQSC.REPLY.QUEUE queue.
Before starting
We must complete the steps in Configure queue managers for remote administration to configure channels, transmission queues, listeners, and the command server before we can remotely administer a queue manager by using MQSC commands.Procedure
- Ensure that the command server is running on the remote queue manager. For information on how to start the command server on a queue manager, see Manage the command server for remote administration.
- On the source queue manager, we can then run MQSC commands in one of two ways:
- Interactively, by starting runmqsc with the following commands:
- If the remote queue manager is on z/OS, enter the following
command:
runmqsc -w 30 -x -m source.queue.manager target.queue.manager
- If the remote queue manager is not on z/OS, enter the following
command:
runmqsc -w 30 -m source.queue.manager target.queue.manager
- If the remote queue manager is on z/OS, enter the following
command:
- From a command file:
- Put the MQSC commands to be run on the remote system in a text file, one command per line.
- Verify your MQSC commands on the local queue manager by using the -v flag on the
runmqsc command. The -v flag checks that the commands are valid, but does not run
them. Be aware that some commands might fail if they are applicable to the remote queue manager but
are not applicable to the local queue
manager:
runmqsc -v source.queue.manager < myCmdFile.in > results.out
The myCmdFile.in contains the MQSC commands to check, and the results.out file contains the verification results for the commands. - Run the command file on the remote queue manager by entering one of the following commands:
- If the remote queue manager is on z/OS, enter the following
command:
runmqsc -w 30 -x -m source.queue.manager target.queue.manager < myCmdFile.in > results.out
- If the remote queue manager is not on z/OS, enter the following
command:
runmqsc -w 30 -m source.queue.manager target.queue.manager < myCmdFile.in > results.out
- If the remote queue manager is on z/OS, enter the following
command:
The parameters used are the following parameters:
- -w seconds
- Specifies that the MQSC commands are run in indirect mode, where commands are put on the command server input queue and executed in order.
- -x
- Specifies that the remote queue manager is a z/OS queue manager.
- -m localQMgrName
- Specifies the name of the local queue manager that we want to use to submit commands to the remote queue manager
- Interactively, by starting runmqsc with the following commands:
What to do next
If we have difficulty in running MQSC commands remotely:- Check that the remote queue manager is running.
- Check that the command server is running on the remote system.
- Check that the channel disconnect interval has not expired. For example, if a channel started but then shut down after some time. This is especially important if you start the channels manually.
- Ensure that the requests that are sent from the local queue manager make sense to the target queue manager. For example, requests that include parameters that are not supported on the remote queue manager.
- Resolving problems with MQSC commands
Parent topic: Work with remote IBM MQ objects