Space announcement This documentation space provides the same content as before, but the organization of the content has changed. The content is now organized based on logical branches instead of legacy book titles. We hope that the new structure will help you quickly find the content that you need.

Setting an enhanced trap on MQ Message Data (MQD) for Code Debug CICS COBOL


  1. Type XPED CSQ4CVB1 on a blank CICS screen and press Enter. The IBM-supplied sample IBM MQ for z/OS program CSQ4CVB1 is displayed on the Source Listing screen (2.L) as shown in following figure.
    CSQ4CVB1 on the Source Listing Screen (2.L)

    -------------------------------- SOURCE LISTING (2.L) ---------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
    MODULE: CSQ4CVB1 CSECT: CSQ4CVB1          COMPILED: 28 JUN 2002 - 15.00.43
    ------   --------------------------------------------------------------------->
    002896                         MOVE SPACES TO M00-MESSAGE.
    002897                         MOVE LOW-VALUES TO CSQ4VB1O.
    002898                    *
    002899                         PERFORM INQUIRE-DEPTH
    002900                    *
    002901                    *    If the depth cannot be obtained, there is no pos
    002902                    *    that the program can work - so exit with a messa
    002903                    *
    002904                         IF M00-MESSAGE NOT = SPACES THEN
    002905           1                 STRING EIBTRNID
    002906           1                        M01-MESSAGE-14
    002907           1                        DELIMITED BY SIZE INTO M00-MESSAGE
    002908           1                 GO TO A-MAIN-EXIT
    002909                         END-IF.
    002910                    *
    002911                    *EXEC CICS IGNORE CONDITION
    002912                    *          MAPFAIL
    002913                    *END-EXEC.
    002914                          MOVE '                      00630   ' TO DFHEIV
    002915                         CALL 'DFHEI1' USING DFHEIV0.


  2. Type BEFORE 2896 in the COMMAND field and press Enter. This sets a before breakpoint on statement 2896. As shown in following figure, Code Debug displays the message
    *********************** BEFORE SET ************************
    Setting a Breakpoint on the Source Listing Screen (2.L)

     ---------------------------------- SOURCE LISTING (2.L) ------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
    MODULE: CSQ4CVB1    *********************** BEFORE SET ***********************
    ------   --------------------------------------------------------------------->
    002896 B                       MOVE SPACES TO M00-MESSAGE.
    002897                         MOVE LOW-VALUES TO CSQ4VB1O.
    002898                    *
    002899                         PERFORM INQUIRE-DEPTH
    002900                    *
    002901                    *    If the depth cannot be obtained, there is no pos
    002902                    *    that the program can work - so exit with a messa
    002903                    *
    002904                         IF M00-MESSAGE NOT = SPACES THEN

    Important

    If your profile specifies TRAP=ON, starting Code Debug automatically creates a trap based on netname and terminal ID. If TRAP=OFF, the trap is created when you set a breakpoint.

  3. Type =1.6 in the COMMAND field and press Enter. The Trap Summary screen (1.6) is displayed (Displaying a Trap on the Trap Summary Screen (1.6)) showing the trap Code Debug automatically created based on netname and terminal ID.
    The breakpoints you set will only be taken when the task is running on netname ACME0027 and terminal 0027. Abends for that netname and terminal will also be trapped.

    Displaying a Trap on the Trap Summary Screen (1.6)

     ----------------------------------- TRAP SUMMARY (1.6) -------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
    MODULE: CSQ4CVB1 CSECT: CSQ4CVB1          COMPILED: 28 JUN 2002 - 15.00.43
    MODE: TERM   (IP TERM or ALL)     NO IP TRAPS                     ENTRY 000001
    LINE COMMANDS:   A (After)   B (Before)   C (Copy)   D (Delete)   I (Insert)
                     M (Move)    S (Save)

     CMD   USERID     NETNAME     TERM     TRAN     PROGRAM   TRAP ABEND
           IF ...................... TRAP CONDITION .......................
     ----------------------------------------------------------------------
      _    ********   ACME0027    0027     ****     ********     YES
           IF
      _    ________   ________    ____     ____     ________     ___
           IF


  4. To create an enhanced trap on MQ message data, overtype ACME0027 in the NETNAME field and 0027 in the TERM field with all asterisks (*), type CSQ4CVB1 in the PROGRAM field, type MQD(1:7)=T'1234567' in the trap condition field on the second line of the trap entry following the word IF, and press Enter.
    Enhanced Trap for MQ Message Data

    ----------------------------------- TRAP SUMMARY (1.6) --------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
    MODULE: CSQ4CVB1 CSECT: CSQ4CVB1          COMPILED: 28 JUN 2002 - 15.00.43
    MODE: TERM   (IP TERM or ALL)     NO IP TRAPS                     ENTRY 000001
    LINE COMMANDS:   A (After)   B (Before)   C (Copy)   D (Delete)   I (Insert)
                     M (Move)    S (Save)

     CMD   USERID     NETNAME     TERM     TRAN     PROGRAM   TRAP ABEND
           IF ...................... TRAP CONDITION .......................
     ----------------------------------------------------------------------
      _    ********   ********    ****     ****     CSQ4CVB1     YES
           IF MQD(1:7) = T'1234567'
      _    ________   ________    ____     ____     ________     ___
           IF

    This enhanced trap causes Code Debug to take breakpoints and trap abends only when the MQ message data has a value of 1234567 for the seven characters starting at position 1.

    Important

    Any breakpoint dependent on MQ information can only be taken after a successful MQGET. If a breakpoint with a trap dependent on MQ information is encountered before the MQGET in a program, the breakpoint will never be taken.

    The literal T'1234567' could also have been entered as '1234567' without the preceding type specification of T.
    This type of trap is useful for enabling enhanced breakpoints in programs for non-terminal tasks. The transaction that initiates CSQ4CVB1 can be started from any platform anywhere on the network, and Code Debug will pause execution at the breakpoint if the specified MQ message data condition is met.

  5. End your debugging session by typing XPND on a blank CICS screen and pressing Enter.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*