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.

Testing without Breakpoints


  1. On a blank CICS screen, type XPED and press Enter.

This activates Code Debug CICS, sets the abend trap option, and displays the Primary Menu as shown in the following figure. The Primary Menu will only display certain choices if the corresponding BMC BMC product or functionality—such as Xchange, Code Coverage, or CICSPlex support—is installed and active in the CICS region.

Primary Menu (XPED/XPRT)

 ------------BMC AMI DevX Code Debug for CICS 17.02.00 PRIMARY MENU --------C024
COMMAND ===>
MODULE:          CSECT:

   0  SESSION PROFILE      - Set default session attributes
   1  SESSION CONTROL      - Analyze summary of session events
   2  DEBUGGING FACILITIES - Interactively debug application programs
   5  FILE UTILITY         - Access datasets, temp stg, trans data, DLI, DB2
   7  ABEND-AID FOR CICS   - Interface to Abend-AID for CICS

   C  CODE COVERAGE        - Interface to Code Coverage
   G  XCHANGE/CICS         - Interface to Xchange's CICS Facilities
   P  CICSPLEX FACILITIES  - Access CICSPlex Control Facilities
   X  EXIT                 - Exit

      To set breakpoints in your program or keep specific data fields,
      enter your program name and use either the SOURCE command or PF key.

      For Online Technical Support refer to: www.bmc.com/support

       NOTICE:  Press PF2/PF14 to display the Copyright/Trade Secret Notice


Code Debug CICS is now turned on and ready to intercept any abends that may occur.

2. To turn on the trace facility, type SET TRACE ON on the COMMAND line and press Enter.

3. Press Clear to return to CICS to start your test.

4. On a blank CICS screen, type XASM and press Enter. The Demonstration Transaction screen appears as shown in the following figure.

Demonstration Transaction Screen

 XASM _____ - ENTER EMPLOYEE NUMBER                                        C123

  *** COMPUWARE CORPORATION ***
     DEMONSTRATION TRANSACTION

   ENTER DESIRED EMPLOYEE ABOVE:
  00001 - CAUSES ASRA ABEND
  00002 - AEIM ABEND
  00003 - AEIP ABEND
  00999 - ENDS NORMALLY

5. To cause an ASRA abend, type 00001 and press Enter. The CWDEMASM demo program is intercepted when the abend occurs, and the Source Listing screen (2.L) is displayed. This gives you the opportunity to fix the problem, re-execute the statement, and continue the test. The display is “clipped” to show only the source code.

6. If you prefer to also see the OPCODE, type SET JUST OFF and press Enter. The display shows the offset and assembly from the source listing, as shown in the following figure.

Important

The line numbers shown in this space may vary from those seen during actual program execution.

Executing SET JUST OFF on the Assembler Source Listing Screen (2.L)

 ----------------------------- SOURCE LISTING (2.L) -----------------------C024
COMMAND ===>                                                   SCROLL ===> CSR
MODULE: CWDEMASM CSECT: CWDEMASM          COMPILED: 09 JUN 2005 - 11.22
   ------- DATA LABEL KEEPS -------- -- ATTRIBUTES -- ----+---10----+---20--->
   CURRPAY                           PL5              +9
   WRKHOUR                           PL3              ?????
   **END**


------   ----------------------------- ASRA (DATA EXCEPTION) at CWDEMASM.603 ->
000600   00024C D200 D26B D24B             MVC   CURRPAY+4(1),WRKRATE  MOVE WRK
000601                            *  IF 00001 WAS ENTERED, AN ASRA WILL
000602                            *  OCCUR ON THE FOLLOWING INSTRUCTION....
=====>   000252 FC42 D267 D25A             MP    CURRPAY,WRKHOUR       MULTIPLY
000604   000258 D204 D26F D267             MVC   CURRTAXS+2(5),CURRPAY MOVE CUR
000605   00025E FC61 D26D D24C             MP    CURRTAXS,WRKTAX       MULTIPLY
000606   000264 FA44 D24E D267             AP    WRKYTDG,CURRPAY       ADD WRKY
000607   00026A FA66 D253 D26D             AP    WRKYTDT,CURRTAXS      ADD WRKY
000608   000270 4100 D7A5         SENDMAP2 LA    R0,PAYMAP2            MOVE
000609   000274 4810 D264                  LH    R1,PAYMP2L            SPACES
000610   000278 41E0 D7A4                  LA    R14,SPACES2           TO
000611   00027C 58F0 33F4                  L     R15,=X'40000000'      MAP
000612   000280 0E0E                       MVCL  R0,R14                TWO.
000613   000282 D21C D7A5 D3DC             MVC   PAYTITL1,MAPTITL1     MOVE

The module and CSECT names are displayed on the third line of the screen along with the assembly date and time to indicate which program is executing. The keep window is next, where all data items from the current statement are automatically displayed. The message on the STATUS line, ASRA (DATA EXCEPTION) at CWDEMASM.603, indicates that an ASRA has been intercepted. In the source statements that follow, the current statement is identified with an arrow =====>.

In this example, the ASRA occurs because one of the fields in the current statement contains bad data. Note the value of WRKHOUR. The bad data in this field is causing the ASRA.

7. The contents of other data items can be checked by using the PEEK primary command. Type PEEK WRKTAX in the COMMAND field and press Enter. Code Debug CICS will transfer to the Defined Storage screen (2.3) with the contents of WRKTAX positioned to the top of the screen as shown in the following figure

Defined Storage Screen (2.3) Accessed with PEEK Command

--------------------------------- DEFINED STORAGE (2.3) -------------------C024
COMMAND ===>                                                   SCROLL ===> CSR
 MODULE: CWDEMASM CSECT: CWDEMASM          COMPILED: 09 JUN 2005 - 11.22


  -------- DATA LABEL -------------- -- ATTRIBUTES -- ----+---10----+---20--->
  WRKTAX                             PL2              +20
   WRKYTDG                            PL5              +15000
   WRKYTDT                            PL7              +3000
   WRKHOUR                            PL3              ?????
   PAYMP1L                            H             'X 0050
   PAYMP1AL                           H             '
X 032E
   PAYMP1BL                           H             'X 0332
   PAYMP2L                            H             '
X 0370
   ZEROS1                             X             'X 00
   CURRPAY                            PL5              +9
   ZEROS2                             X             '
X 00
   CURRTAXS                           PL7              ?????????????
   RATEINCR                           CL3              000
   DUMMYLEN                           H             'X 0008
   DUMMYEMP                           0CL8             . F00001
                                      CL3              . F
   DUMMYPAY                           CL5              00001
   EMP001                             0CL61            NMR. DAVID ABEND456 MAIN

8. Press PF3 (END) to return to the Source Listing screen (2.L).

9. As you could see in Executing SET JUST OFF on the Assembler Source Listing Screen (2.L), the contents of WRKHOUR is non-numeric. This is designated by question marks (?????) in the field contents. To view the actual contents of WRKHOUR, do the following:

Important

The following step requires that CSR be entered in your SCROLL field.

a. Place the cursor on WRKHOUR in the keep window and press PF8 (DOWN) to position it to the top line.
b. Type HEX ON in the COMMAND field and press Enter.

The hex value for WRKHOUR will be displayed in the keep window as shown in the following figure.

Source Listing Screen (2.L) Showing Contents of WRKHOUR

--------------------------------- SOURCE LISTING (2.L) --------------------C024
COMMAND ===>                                                   SCROLL ===> CSR
MODULE: CWDEMASM CSECT: CWDEMASM          COMPILED: 09 JUN 2005 - 11.22
   ------- DATA LABEL KEEPS -------- -- ATTRIBUTES -- ----+---10----+---20--->
   WRKHOUR                           PL3              $$$
                                                      555
                                                      BBB


------   ----------------------------- ASRA (DATA EXCEPTION) at CWDEMASM.603 ->
000600   00024C D200 D26B D24B             MVC   CURRPAY+4(1),WRKRATE  MOVE WRK
000601                            *  IF 00001 WAS ENTERED, AN ASRA WILL
000602                            *  OCCUR ON THE FOLLOWING INSTRUCTION....
=====>   000252 FC42 D267 D25A             MP    CURRPAY,WRKHOUR       MULTIPLY
000604   000258 D204 D26F D267             MVC   CURRTAXS+2(5),CURRPAY MOVE CUR
000605   00025E FC61 D26D D24C             MP    CURRTAXS,WRKTAX       MULTIPLY
000606   000264 FA44 D24E D267             AP    WRKYTDG,CURRPAY       ADD WRKY
000607   00026A FA66 D253 D26D             AP    WRKYTDT,CURRTAXS      ADD WRKY
000608   000270 4100 D7A5         SENDMAP2 LA    R0,PAYMAP2            MOVE
000609   000274 4810 D264                  LH    R1,PAYMP2L            SPACES
000610   000278 41E0 D7A4                  LA    R14,SPACES2           TO
000611   00027C 58F0 33F4                  L     R15,=X'40000000'      MAP
000612   000280 0E0E                       MVCL  R0,R14                TWO.
000613   000282 D21C D7A5 D3DC             MVC   PAYTITL1,MAPTITL1     MOVE

10. Type HEX OFF in the COMMAND field and press Enter.

11. Autokeeps are displayed only for the statement currently executing. To continue displaying the value of WRKHOUR as you step further through the program, set an explicit keep as follows:

a. Move the cursor next to WRKHOUR in the keep window.

b. Type K and press Enter.

Another way to set this keep would be to type KEEP WRKHOUR in the COMMAND field and press Enter.

A feature called Intelligent Autokeeps is an extension to Code Debug’s autokeep facility. This feature is enabled by default, but can be disabled in your individual profile settings. With Intelligent Autokeeps enabled, if an autokeep variable could be modified by the execution of the current statement, it will be redisplayed in the keep window when you step to the next statement. This intellikeep can often eliminate the need to set, then later remove, an explicit keep. The Intelligent Autokeeps feature will not display an autokeep if a duplicate explicit keep has been set.

Important

For a more complete explanation of autokeeps and the Intelligent Autokeeps feature, BMC encourages you to use the HELP AUTOKEEPS and HELP INTELLIKEEPS commands built into Code Debug CICS. These Help topics provide highly detailed information and examples, as well as performing real-time evaluations to point out any restrictions you might encounter while attempting to use these facilities.

12. At this point, two methods can be used to prevent the ASRA abend from occurring:

a. The first method is to change the value of WRKHOUR to a valid number:

1. Change ????? to 40 and press Enter. This can be done for the explicit keep or the autokeep for WRKHOUR.

2. Press PF9 (GO 1) to get to the next statement as shown in the following figure.

Changing the Value of WRKHOUR on the Source Listing Screen (2.L)

 --------------------------------- SOURCE LISTING (2.L) -------------------C024
COMMAND ===>                                                   SCROLL ===> CSR
MODULE: CWDEMASM    ****** ASM-INST AT OFFSET 0252 EXECUTED  STEP=00001 *******
   ------- DATA LABEL KEEPS -------- -- ATTRIBUTES -- ----+---10----+---20--->
K  WRKHOUR                           PL3              +40
   CURRTAXS                          PL7              ?????????????
   CURRPAY                           PL5              +360
   **END**

------   ----------------------------------------------- Before CWDEMASM.604 ->
000600   00024C D200 D26B D24B             MVC   CURRPAY+4(1),WRKRATE  MOVE WRK
000601                            *  IF 00001 WAS ENTERED, AN ASRA WILL
000602                            *  OCCUR ON THE FOLLOWING INSTRUCTION....
000603   000252 FC42 D267 D25A             MP    CURRPAY,WRKHOUR       MULTIPLY
=====>   000258 D204 D26F D267             MVC   CURRTAXS+2(5),CURRPAY MOVE CUR
000605   00025E FC61 D26D D24C             MP    CURRTAXS,WRKTAX       MULTIPLY
000606   000264 FA44 D24E D267             AP    WRKYTDG,CURRPAY       ADD WRKY
000607   00026A FA66 D253 D26D             AP    WRKYTDT,CURRTAXS      ADD WRKY
000608   000270 4100 D7A5         SENDMAP2 LA    R0,PAYMAP2            MOVE
000609   000274 4810 D264                  LH    R1,PAYMP2L            SPACES
000610   000278 41E0 D7A4                  LA    R14,SPACES2           TO
000611   00027C 58F0 33F4                  L     R15,=X'40000000'      MAP
000612   000280 0E0E                       MVCL  R0,R14                TWO.
000613   000282 D21C D7A5 D3DC             MVC   PAYTITL1,MAPTITL1     MOVE

b. Instead of changing the value number, the second method is to change the Assembler instruction using the VERIFY command.

Important

The line numbers shown in this space may vary from those seen during actual program execution. For correct results, use the applicable line numbers seen on your screen.

1. Type GT on statement 603 and press Enter.

2. Type VERIFY 603 on the COMMAND line and press Enter. The result of the VERIFY command is shown in the following figure.

Important

The VERIFY command does not allow instructions to be altered for programs residing in (E)RDSA. The message <- PROT STG will be displayed on the line where you tried to set the verify.

Changing the Value of WRKHOUR Using the VERIFY Command

 -------------------------------- SOURCE LISTING (2.L) --------------------C024
COMMAND ===>                                                   SCROLL ===> CSR
MODULE: CWDEMASM    *********************** VERIFY set ************************
   ------- DATA LABEL KEEPS -------- -- ATTRIBUTES -- ----+---10----+---20--->
K  WRKHOUR                           PL3              +40
   CURRPAY                           PL5              +360
   **END**


------   ----------------------------------------------- Before CWDEMASM.603 ->
000600   00024C D200 D26B D24B             MVC   CURRPAY+4(1),WRKRATE  MOVE WRK
000601                            *  IF 00001 WAS ENTERED, AN ASRA WILL
000602                            *  OCCUR ON THE FOLLOWING INSTRUCTION....
=====>   MP     FC42 D267 D25A <- PROT STG MP    CURRPAY,WRKHOUR       MULTIPLY
000604   000258 D204 D26F D267             MVC   CURRTAXS+2(5),CURRPAY MOVE CUR
000605   00025E FC61 D26D D24C             MP    CURRTAXS,WRKTAX       MULTIPLY
000606   000264 FA44 D24E D267             AP    WRKYTDG,CURRPAY       ADD WRKY
000607   00026A FA66 D253 D26D             AP    WRKYTDT,CURRTAXS      ADD WRKY
000608   000270 4100 D7A5         SENDMAP2 LA    R0,PAYMAP2            MOVE
000609   000274 4810 D264                  LH    R1,PAYMP2L            SPACES
000610   000278 41E0 D7A4                  LA    R14,SPACES2           TO
000611   00027C 58F0 33F4                  L     R15,=X'40000000'      MAP
000612   000280 0E0E                       MVCL  R0,R14                TWO.
000613   000282 D21C D7A5 D3DC             MVC   PAYTITL1,MAPTITL1     MOVE

c. If WRKHOUR still had bad data, you could get temporarily past the ASRA by changing the instruction to multiply CURRPAY by PAYHOUR9 as follows:

1. Change the second operand of the instruction from D25A to D2F9 and press Enter.

2. Press PF9 to single-step past the modified instruction.

You have now changed the value of CURRPAY, and temporarily corrected the ASRA.

13. Press PF12 (GO) to continue processing. If any other abends occur, Code Debug CICS will intercept them. Upon completion, the following figure is displayed. The GROSS PAY shown will depend on the way in which you resolved the abend.

Transaction Complete Screen

 *** COMPUWARE CORPORATION ***
  DEMONSTRATION TRANSACTION

 EMPLOYEE NUMBER: 00001
 EMPLOYEE NAME:   MR. DAVID ABEND
 HOURS WORKED:    00040
 HOURLY RATE:     9.00
 GROSS PAY:       0000360.00

*** TRANSACTION COMPLETE ***

14. Always end your debugging session as described in Exiting Code Debug CICS and Ending a Debugging Session.

 

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