Script (MQSC) commands

MQSC commands provide a uniform method of issuing human-readable commands on IBM® MQ platforms.

The general format of the commands is described in The MQSC commands.

You should observe the following rules when using MQSC commands:
  • Each command starts with a primary parameter (a verb), and this is followed by a secondary parameter (a noun). This is then followed by the name or generic name of the object (in parentheses) if there is one, which there is on most commands. Following that, parameters can usually occur in any order; if a parameter has a corresponding value, the value must occur directly after the parameter to which it relates.
    [z/OS]Note: On z/OS®, the secondary parameter does not have to be second.
  • Keywords, parentheses, and values can be separated by any number of blanks and commas. A comma shown in the syntax diagrams can always be replaced by one or more blanks. There must be at least one blank immediately preceding each parameter (after the primary parameter) except on z/OS .
  • Any number of blanks can occur at the beginning or end of the command, and between parameters, punctuation, and values. For example, the following command is valid:
    ALTER QLOCAL ('Account' )      TRIGDPTH ( 1)
    Blanks within a pair of quotation marks are significant.
  • Additional commas can appear anywhere where blanks are allowed and are treated as if they were blanks (unless, of course, they are inside strings enclosed by quotation marks).
  • Repeated parameters are not allowed. Repeating a parameter with its "NO" version, as in REPLACE NOREPLACE, is also not allowed.
  • Strings that contain blanks, lowercase characters or special characters other than:
    • Period (.)
    • Forward slash (/)
    • Underscore (_)
    • Percent sign (%)
    must be enclosed in single quotation marks, unless they are:
    • [z/OS]Issued from the IBM MQ for z/OS operations and control panels
    • Generic values ending with an asterisk (on IBM i these must be enclosed in single quotation marks)
    • A single asterisk, for example, TRACE(*) (on IBM i these must be enclosed in single quotation marks)
    • A range specification containing a colon, for example, CLASS(01:03)

    If the string itself contains a single quotation mark, the single quotation mark is represented by two single quotation marks. Lowercase characters not contained within quotation marks are folded to uppercase.

  • [UNIX, Linux, Windows, IBM i]On Multiplatforms, a string containing no characters (that is, two single quotation marks with no space in between) is interpreted as a blank space enclosed in single quotation marks, that is, interpreted in the same way as (' '). The exception to this is if the attribute being used is one of the following:
    • SUB
    then two single quotation marks with no space are interpreted as a zero-length string.

    [z/OS]On z/OS, if you want a blank space enclosed in single quotation marks, you must enter it as such (' '). A string containing no characters ('') is the same as entering ().

  • In IBM WebSphere® MQ 7.0, any trailing blanks in those string attributes which are based on MQCHARV types, such as SELECTOR, sub user data, are treated as significant which means that 'abc ' does not equal 'abc'.
  • A left parenthesis followed by a right parenthesis, with no significant information in between, for example
    NAME ( )
    is not valid except where specifically noted.
  • Keywords are not case sensitive: AltER, alter, and ALTER are all acceptable. Anything that is not contained within quotation marks is folded to uppercase.
  • Synonyms are defined for some parameters. For example, DEF is always a synonym for DEFINE, so DEF QLOCAL is valid. Synonyms are not, however, just minimum strings; DEFI is not a valid synonym for DEFINE.
    Note: There is no synonym for the DELETE parameter. This is to avoid accidental deletion of objects when using DEF, the synonym for DEFINE.

For an overview of using MQSC commands for administering IBM MQ, see Administering MQ by using MQSC commands.

MQSC commands use certain special characters to have certain meanings. For more information about these special characters and how to use them, see Characters with special meanings.

To find out how you can build scripts using MQSC commands, see Building command scripts.

For the full list of MQSC commands, see The MQSC commands.

You can issue this command from sources 2CR. For an explanation of the source symbols, see Using commands on z/OS.