Script (MQSC) Commands

MQSC commands provide a uniform method of issuing human-readable commands on WebSphere® MQ platforms. For information about programmable command format (PCF) commands, see Introduction to Programmable Command Formats.

The general format of the commands is shown 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.
  • 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).
  • 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:
    • Generic values ending with an asterisk
    • A single asterisk (for example, TRACE(*))
    • 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.

  • On platforms other than z/OS®, 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:
    • TOPICSTR
    • SUB
    • USERDATA
    • SELECTOR
    then two single quotation marks with no space are interpreted as a zero-length string.
  • In v7.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® WebSphere MQ, see Performing local administration tasks 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.