Issuing MQSC commands on a remote queue manager

After you configure queue managers for remote administration, you 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 you begin

You must complete the steps in Configuring queue managers for remote administration to configure channels, transmission queues, listeners, and the command server before you can remotely administer a queue manager by using MQSC commands.

Procedure

  1. 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 Managing the command server for remote administration.
  2. On the source queue manager, you can then run MQSC commands in one of two ways:
    • Interactively, by starting runmqsc with the following commands:
      • [z/OS]If the remote queue manager is on z/OS®, enter the following command:
        
        runmqsc -w 30 -x -m source.queue.manager target.queue.manager
        
      • [UNIX, Linux, Windows, IBM i]If the remote queue manager is not on z/OS, enter the following command:
        
        runmqsc -w 30 -m source.queue.manager target.queue.manager
        
    • From a command file:
      1. Put the MQSC commands to be run on the remote system in a text file, one command per line.
      2. 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.
      3. Run the command file on the remote queue manager by entering one of the following commands:
        • [z/OS]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
        • [UNIX, Linux, Windows, IBM i]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
          
    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.
    The variable seconds specifies the length of time to wait, in seconds, for a response from the remote queue manager. Any replies received after this time are discarded, but the MQSC commands still run on the remote queue manager. The following message is generated on the local queue manager when the command times out:
    
    AMQ8416: MQSC timed out waiting for a response from the command server.
    
    When you stop issuing MQSC commands, the local queue manager displays any timed-out responses that have arrived and discards any further responses.
    -x
    Specifies that the remote queue manager is a z/OS queue manager.
    -m localQMgrName
    Specifies the name of the local queue manager that you want to use to submit commands to the remote queue manager

What to do next

If you 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