MQSC input file syntax

If you have long commands, or are using a particular sequence of commands repeatedly, you can use an input file to issue MQSC commands. The contents of the input file must follow the syntax described in this topic.

Overview

MQSC commands are input through the standard input device, also referred to as stdin. Typically this is the keyboard, but you can specify that input is to come from an input file.

You can use this input file with any of the following platform-specific tools:

Syntax

MQSC input file syntax:
  • For portability among IBM MQ environments, limit the line length in MQSC command files to 72 characters.
  • Each command must start on a new line.
  • A line starting with an asterisk (*) in the first position is ignored. This can be used to insert comments into the file.
  • Blank lines are ignored.
  • A plus sign (+) indicates that the command is continued from the first non-blank character in the next line. If you use + to continue a command, remember to leave at least one blank before the next parameter (except on z/OS where this is not necessary). Any comments or blank lines are discarded when the command is reassembled into a single string.
  • A minus sign (-), this indicates that the command is to be continued from the start of the next line. Any comments or blank lines are discarded when the command is reassembled into a single string.
  • MQSC commands that are contained within an Escape PCF (Programmable Command Format) command cannot be continued with the plus sign, or the minus sign. The entire command must be contained within a single Escape command. For information about the PCF commands, see Introduction to IBM MQ Programmable Command Formats.
  • On Multiplatforms, and on z/OS for commands issued from the CSQUTIL batch utility program, you can use a semicolon character (;) to terminate a command, even if you have entered a plus sign (+) at the end of the previous line.
  • A line must not end in a keyboard control character (for example, a tab).
  • If you run the runmqsc command in client mode by redirecting stdin from a text file, and you supply the -u flag to provide credentials, the runmqsc command does not prompt for a password and instead the password is read from stdin. You should ensure that the first line of data provided through stdin is the password. This can be done by using command line tools such as "echo" or "cat" and passing the password followed by the MQSC script into the runmqsc command stdin.
  • [Windows]On Windows, if certain special characters such as the pound sign (£) and the logical NOT (¬) are used in a command script (for example, as part of an object description), they are displayed differently in the output from a command such as DISPLAY QLOCAL.

See also MQSC command syntax.

Examples

The following example is an extract from an MQSC command file that shows command DEFINE QLOCAL.
Figure 1. Extract from an MQSC command file
DEFINE QLOCAL(ORANGE.LOCAL.QUEUE) REPLACE +
DESCR(' ') +
PUT(ENABLED) +
DEFPRTY(0) +
DEFPSIST(NO) +
GET(ENABLED) +
MAXDEPTH(5000) +
MAXMSGL(1024) +
DEFSOPT(SHARED) +
NOHARDENBO +
USAGE(NORMAL) +
NOTRIGGER;
When the runmqsc command completes, a report is returned. The following example is an extract from a report:
Figure 2. Extract from an MQSC command report file
Starting MQSC for queue manager jupiter.queue.manager.
.
.
12:   DEFINE QLOCAL('ORANGE.LOCAL.QUEUE') REPLACE +
:      DESCR(' ') +
:      PUT(ENABLED) +
:      DEFPRTY(0) +
:      DEFPSIST(NO) +
:      GET(ENABLED) +
:      MAXDEPTH(5000) +
:      MAXMSGL(1024) +
:      DEFSOPT(SHARED) +
:      NOHARDENBO +
:      USAGE(NORMAL) +
:      NOTRIGGER;
AMQ8006: IBM MQ queue created.
:
.
.
You can also use the example MQSC command files to help you create your text file:
amqscos0.tst
Definitions of objects used by sample programs.
amqscic0.tst
Definitions of queues for CICS® transactions.

[AIX][Linux]On AIX and Linux, these files are located in the directory MQ_INSTALLATION_PATH/samp. MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.

[Windows]On Windows, these files are located in the directory MQ_INSTALLATION_PATH\tools\mqsc\samples. MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.