Examples of commands and their replies

Use this topic as a series of examples of commands to the command server and the responses from the command server.

Here are some examples of commands that could be built into IBM MQ messages, and the user messages that are the replies. Unless otherwise stated, each line of the reply is a separate message.

    Messages from a DEFINE command
    The following command:
    DEFINE QLOCAL(Q1)
    
    produces these messages:
    CSQN205I    COUNT=    2, RETURN=00000000, REASON=00000000
    CSQ9022I +CSQ1 CSQMMSGP ' DEFINE QLOCAL' NORMAL COMPLETION
    

    These reply messages are produced on normal completion.

    Messages from a DELETE command
    The following command:
    DELETE QLOCAL(Q2)
    
    produces these messages:
    CSQN205I    COUNT=    4, RETURN=0000000C, REASON=00000008
    CSQM125I +CSQ1 CSQMUQLC QLOCAL (Q2) QSGDISP(QMGR) WAS NOT FOUND
    CSQM090E +CSQ1 CSQMUQLC FAILURE REASON CODE X'00D44002'
    CSQ9023E +CSQ1 CSQMUQLC ' DELETE QLOCAL' ABNORMAL COMPLETION
    

    These messages indicate that a local queue called Q2 does not exist.

    Messages from DISPLAY commands

    The following examples show the replies from some DISPLAY commands.

      Finding out the name of the dead-letter queue
      To find out the name of the dead-letter queue for a queue manager, issue this command from an application program:
      DISPLAY QMGR DEADQ
      
      The following three user messages are returned, from which we can extract the required name:
      CSQN205I    COUNT=    3, RETURN=00000000, REASON=00000000
      CSQM409I +CSQ1 QMNAME(CSQ1) DEADQ(SYSTEM.DEAD.QUEUE          )
      CSQ9022I +CSQ1 CSQMDRTS ' DISPLAY QMGR' NORMAL COMPLETION
      

      Messages from the DISPLAY QUEUE command

      The following examples show how the results from a command depend on the attributes specified in that command.

        Example 1
        You define a local queue using the command:
        DEFINE QLOCAL(Q1) DESCR('A sample queue') GET(ENABLED) SHARE
        
        If we issue the following command from an application program:
        DISPLAY QUEUE(Q1) SHARE GET DESCR
        
        these three user messages are returned:
        CSQN205I    COUNT=    3, RETURN=00000000, REASON=00000000
        CSQM401I +CSQ1 QUEUE(Q1                       ) TYPE(
        QLOCAL ) QSGDISP(QMGR   )
        DESCR(A sample queue
        ) SHARE  GET(ENABLED  )
        CSQ9022I +CSQ1 CSQMDMSG ' DISPLAY QUEUE' NORMAL COMPLETION
        
        Note: The second message, CSQM401I, is shown here occupying four lines.

        Example 2
        Two queues have names beginning with the letter A:

        • A1 is a local queue with its PUT attribute set to DISABLED.
        • A2 is a remote queue with its PUT attribute set to ENABLED.

        If we issue the following command from an application program:

        DISPLAY QUEUE(A*) PUT
        
        these four user messages are returned:
        CSQN205I    COUNT=    4, RETURN=00000000, REASON=00000000
        CSQM401I +CSQ1 QUEUE(A1                       ) TYPE(
        QLOCAL ) QSGDISP(QMGR   )
        PUT(DISABLED )
        CSQM406I +CSQ1 QUEUE(A2                       ) TYPE(
        QREMOTE ) PUT(ENABLED  )
        CSQ9022I +CSQ1 CSQMDMSG ' DISPLAY QUEUE' NORMAL COMPLETION
        
        Note: The second and third messages, CSQM401I and CSQM406I, are shown here occupying three and two lines.

      Messages from the DISPLAY NAMELIST command
      You define a namelist using the command:
      DEFINE NAMELIST(N1) NAMES(Q1,SAMPLE_QUEUE)
      
      If we issue the following command from an application program:
      DISPLAY NAMELIST(N1) NAMES NAMCOUNT
      
      the following three user messages are returned:
      CSQN205I    COUNT=    3, RETURN=00000000, REASON=00000000
      CSQM407I +CSQ1 NAMELIST(N1                       ) QS
      GDISP(QMGR   ) NAMCOUNT(     2) NAMES(Q1
      ,SAMPLE_QUEUE                  )
      CSQ9022I +CSQ1 CSQMDMSG ' DISPLAY NAMELIST' NORMAL COMPLETION
      
      Note: The second message, CSQM407I, is shown here occupying three lines.

    Messages from commands with CMDSCOPE

    The following examples show the replies from commands that have been entered with the CMDSCOPE attribute.

      Messages from the ALTER PROCESS command
      The following command:
      ALT PRO(V4) CMDSCOPE(*)
      
      produces the following messages:
      CSQN205I  COUNT=    2, RETURN=00000000, REASON=00000004
      CSQN137I !MQ25 'ALT PRO' command accepted for CMDSCOPE(*), sent to 2
      CSQN205I  COUNT=    5, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'ALT PRO' command responses from MQ26
      CSQM125I !MQ26 CSQMMSGP PROCESS(V4) QSGDISP(QMGR) WAS NOT FOUND
      CSQM090E !MQ26 CSQMMSGP FAILURE REASON CODE X'00D44002'
      CSQ9023E !MQ26 CSQMMSGP ' ALT PRO' ABNORMAL COMPLETION
      CSQN205I  COUNT=    3, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'ALT PRO' command responses from MQ25
      CSQ9022I !MQ25 CSQMMSGP ' ALT PRO' NORMAL COMPLETION
      CSQN205I  COUNT=    2, RETURN=0000000C, REASON=00000008
      CSQN123E !MQ25 'ALT PRO' command for CMDSCOPE(*) abnormal completion
      

      These messages tell you that the command was entered on queue manager MQ25 and sent to two queue managers (MQ25 and MQ26). The command was successful on MQ25 but the process definition did not exist on MQ26, so the command failed on that queue manager.

      Messages from the DISPLAY PROCESS command
      The following command:
      DIS PRO(V*) CMDSCOPE(*)
      
      produces the following messages:
      CSQN205I  COUNT=    2, RETURN=00000000, REASON=00000004
      CSQN137I !MQ25 'DIS PRO' command accepted for CMDSCOPE(*), sent to 2
      CSQN205I  COUNT=    5, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'DIS PRO' command responses from MQ26
      CSQM408I !MQ26 PROCESS(V2) QSGDISP(COPY)
      CSQM408I !MQ26 PROCESS(V3) QSGDISP(QMGR)
      CSQ9022I !MQ26 CSQMDRTS ' DIS PROCESS' NORMAL COMPLETION
      CSQN205I  COUNT=    7, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'DIS PRO' command responses from MQ25
      CSQM408I !MQ25 PROCESS(V2) QSGDISP(COPY)
      CSQM408I !MQ25 PROCESS(V2) QSGDISP(GROUP)
      CSQM408I !MQ25 PROCESS(V3) QSGDISP(QMGR)
      CSQM408I !MQ25 PROCESS(V4) QSGDISP(QMGR)
      CSQ9022I !MQ25 CSQMDRTS ' DIS PROCESS' NORMAL COMPLETION
      CSQN205I  COUNT=    2, RETURN=00000000, REASON=00000000
      CSQN122I !MQ25 'DIS PRO' command for CMDSCOPE(*) normal completion
      

      These messages tell you that the command was entered on queue manager MQ25 and sent to two queue managers (MQ25 and MQ26). Information is displayed about all the processes on each queue manager with names starting with the letter V.

      Messages from the DISPLAY CHSTATUS command
      The following command:
      DIS CHS(VT) CMDSCOPE(*)
      
      produces the following messages:
      CSQN205I  COUNT=    2, RETURN=00000000, REASON=00000004
      CSQN137I !MQ25 'DIS CHS' command accepted for CMDSCOPE(*), sent to 2
      CSQN205I  COUNT=    4, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'DIS CHS' command responses from MQ25
      CSQM422I !MQ25 CHSTATUS(VT) CHLDISP(PRIVATE) CONNAME( ) CURRENT STATUS(STOPPED)
      CSQ9022I !MQ25 CSQXDRTS ' DIS CHS' NORMAL COMPLETION
      CSQN205I  COUNT=    4, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'DIS CHS' command responses from MQ26
      CSQM422I !MQ26 CHSTATUS(VT) CHLDISP(PRIVATE) CONNAME( ) CURRENT STATUS(STOPPED)
      CSQ9022I !MQ26 CSQXDRTS ' DIS CHS' NORMAL COMPLETION
      CSQN205I  COUNT=    2, RETURN=00000000, REASON=00000000
      CSQN122I !MQ25 'DIS CHS' command for CMDSCOPE(*) normal completion
      

      These messages tell you that the command was entered on queue manager MQ25 and sent to two queue managers (MQ25 and MQ26). Information is displayed about channel status on each queue manager.

      Messages from the STOP CHANNEL command
      The following command:
      STOP CHL(VT) CMDSCOPE(*)
      
      produces these messages:
      CSQN205I  COUNT=    2, RETURN=00000000, REASON=00000004
      CSQN137I !MQ25 'STOP CHL' command accepted for CMDSCOPE(*), sent to 2
      CSQN205I  COUNT=    3, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'STOP CHL' command responses from MQ25
      CSQM134I !MQ25 CSQMTCHL STOP CHL(VT) COMMAND ACCEPTED
      SQN205I  COUNT=    3, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'STOP CHL' command responses from MQ26
      CSQM134I !MQ26 CSQMTCHL STOP CHL(VT) COMMAND ACCEPTED
      CSQN205I  COUNT=    3, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'STOP CHL' command responses from MQ26
      CSQ9022I !MQ26 CSQXCRPS ' STOP CHL' NORMAL COMPLETION
      CSQN205I  COUNT=    3, RETURN=00000000, REASON=00000004
      CSQN121I !MQ25 'STOP CHL' command responses from MQ25
      CSQ9022I !MQ25 CSQXCRPS ' STOP CHL' NORMAL COMPLETION
      CSQN205I  COUNT=    2, RETURN=00000000, REASON=00000000
      CSQN122I !MQ25 'STOP CHL' command for CMDSCOPE(*) normal completion
      

      These messages tell you that the command was entered on queue manager MQ25 and sent to two queue managers (MQ25 and MQ26). Channel VT was stopped on each queue manager.

    Messages from commands that generate commands with CMDSCOPE
    The following command:
    DEF PRO(V2) QSGDISP(GROUP)
    
    produces these messages:
    CSQN205I  COUNT=    3, RETURN=00000000, REASON=00000004
    CSQM122I !MQ25 CSQMMSGP ' DEF PRO' COMPLETED FOR QSGDISP(GROUP)
    CSQN138I !MQ25 'DEFINE PRO' command generated for CMDSCOPE(*), sent to 2
    CSQN205I  COUNT=    3, RETURN=00000000, REASON=00000004
    CSQN121I !MQ25 'DEFINE PRO' command responses from MQ25
    CSQ9022I !MQ25 CSQMMSGP ' DEFINE PROCESS' NORMAL COMPLETION
    CSQN205I  COUNT=    3, RETURN=00000000, REASON=00000004
    CSQN121I !MQ25 'DEFINE PRO' command responses from MQ26
    CSQ9022I !MQ26 CSQMMSGP ' DEFINE PROCESS' NORMAL COMPLETION
    CSQN205I  COUNT=    2, RETURN=00000000, REASON=00000000
    CSQN122I !MQ25 'DEFINE PRO' command for CMDSCOPE(*) normal completion
    

    These messages tell you that the command was entered on queue manager MQ25. When the object was created on the shared repository, another command was generated and sent to all the active queue managers in the queue sharing group (MQ25 and MQ26).

Parent topic: Writing programs to administer IBM MQ for z/OS