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.

Modifying Storage (Code Debug CICS PL/I)


Next, you will apply the values from the listing to view and modify the data in storage.

Before continuing, we know the code generated by the compiler isn’t straightforward and simple. In looking at the code for line number 837 (Assembler Listing (LIST) from COBOL Compiler), we see there are no references to the variables WA_HOURS or WA_RATE. This probably means the actual MP instruction where the abend occurred does not necessarily directly reference the variables either. In order to verify where the variables reside, we need to reference our compiled listing.

If we look in the source listing where WA_HOURS and WA_RATE are defined, we discover they are actually defined in a structure 'WORK_AREA', which is a based variable (following figure). It is based on field WA_PTR. The value in field WA_PTR is the actual address of the structure.

Data Division from Compiler Listing

  124.1                                                                              00000084
 125.1           DCL   01  WORK_AREA BASED(WA_PTR),                                 00000085
 126.1                05  WA_TYPE     CHAR (1),                                     00000086
 127.1                05  WA_NAME     CHAR (15),                                    00000087
 128.1                05  WA_ADDRESS,                                               00000088
 129.1                    10  WA_STREET   CHAR (12),                                00000089
 130.1                    10  WA_CITY     CHAR (8),                                 00000090
 131.1                    10  WA_STATE    CHAR (2),                                 00000091
 132.1                    10  WA_ZIP      CHAR (5),                                 00000092
 133.1                05  WA_RATE     FIXED DEC(5,2),                               00000093
 134.1                05  WA_DATE_EFF,                                              00000094
 135.1                    10  WA_DTEFF_MM CHAR(2),                                  00000095
 136.1                    10  WA_DTEFF_DD CHAR(2),                                  00000096
 137.1                    10  WA_DTEFF_YY CHAR(2),                                  00000097
 138.1                05  WA_LST_PCT  FIXED DEC(4,1),                               00000098
 139.1                05  WA_TAX_RAT  FIXED DEC(4,1),                               00000099
 140.1                05  WA_YTD_GRS  FIXED DEC(7,2),                               00000100
 141.1                05  WA_YTD_TAX  FIXED DEC(7,2),                               00000101
 142.1                05  WA_HOURS    PIC'999',                                     00000102
 143.1                05  WA_MSG      CHAR(26);                                     00000103
 144.1           DCL  WA_PTR          POINTER ;                                     00000104

We need to determine the address currently in WA_PTR. First, we need to find the offset of WA_PTR in the DSA for the program. Unfortunately, we do not have a variable storage map section in our listing. While this would make it easy to find where WA-PTR resides, we can simply look in the generated code. If we look at Assembler Listing (LIST) from COBOL Compiler, we can see that WA_PTR is referenced in the instruction 'L r1,WA_PTR(,r13,500)'. The comment indicates it is at offset 500 (x'1F4') from register 13.

To find the field containing the invalid data, we first locate to the storage pointed at by register 13. The Memory Display screen (2.2) is used to locate the invalid data.

  1. Press PF14, or type =2.2 in the COMMAND field and press Enter. The following figure appears.
    Viewing Program Storage on the Memory Display Screen (2.2)

    -------------------------------- MEMORY DISPLAY (2.2) ---------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
     MODULE: CWDEMPE  CSECT: CWDEMPE           COMPILED: 09 JUN 2005 - 11:23:48
    TABLE/AREA: PGM                                  TABLE ENTRY ID: ________
     ADDRESS:    38CDCD08          HEX OFFSET: _______________________________
     USE CONTENTS: _               ADD OFFSET: _____                       ERDSA

                                                      CCSID TYPE: EBCDIC
    00000000 000 F2F0F0F5 F0F6F0F9 F1F1F2F3 F4F8F0F3 * 2005060911234803 * 389F6FA8
    00000010 010 F0F1F0F0 00280801 00035B6A 079E0000 * 0100.......Æ.. * 389F6FB8
    00000020 020 04746464 3F3F1FFE 09410302 0108006C * .ÈÀÀ...Ú. .....% * 389F6FC8
    00000030 030 36000301 0FF80000 04F00000 08680000 * .....8...0...Ç.. * 389F6FD8
    00000040 040 47F0F028 01C3C5C5 00001CE8 00005450 * å00..CEE...Y..è& * 389F6FE8
    00000050 050 47F0F001 58F0C31C 184E05EF 00000000 * å00.ì0C..+.Õ.... * 389F6FF8
    00000060 060 05404140 402007F4 90EBD00C 58E0D04C * .    ..4°Ô}.ì\}< * 389F7008
    00000070 070 5800F008 1E0E5500 C3144140 F0424720 * ì.0...í.C.  0âå. * 389F7018
    00000080 080 F01458F0 C28090F0 E0489210 E00050D0 * 0.ì0Bذ0k.\.&} * 389F7028
    00000090 090 E00418DE 5800C1F4 5000DE00 5820DE00 * \..úì.A4&.ú.ì.ú. * 389F7038
    000000A0 0A0 58304FE6 41632000 58504FEA 412D0E10 * ì.|W Ä..ì&|² ... * 389F7048
    000000B0 0B0 50102C94 411028D8 D2041000 51424110 * &..m ..QK...éâ . * 389F7058
    000000C0 0C0 28D8D204 10055147 411028E2 50102B0C * .QK...éå ..S&... * 389F7068
    000000D0 0D0 92401000 D2081001 10005800 2B0CD207 * k ..K.....ì...K. * 389F7078
    000000E0 0E0 28EC59A8 411028D8 D2041005 514C4110 * .Ößy ..QK...é< . * 389F7088
    000000F0 0F0 28E25010 2B0C9240 1000D208 10011000 * .S&...k ..K..... * 389F7098

    The Memory Display screen (2.2) shows a hexadecimal dump of the your test program. Any instruction or data in your program is available from here. Simply type the displacement you wish to see in the HEX (or ADD) OFFSET fields.

  2. To display storage for the work area containing the bad data (WA_PTR), overtype PGM in the TABLE/AREA field with R13, type +1F4 in the HEX OFFSET field, type X in the USE CONTENTS field and press Enter. This positions the display to the address contained in field WA_PTR. The following figure shows the storage for WORK_AREA displayed on the Memory Display screen (2.2).
    Displaying the Address of WA_PTR

     ------------------------------- MEMORY DISPLAY (2.2) ---------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
     MODULE: CWDEMPE  CSECT: CWDEMPE           COMPILED: 09 JUN 2005 - 11:23:48
    TABLE/AREA: ADDR                                 TABLE ENTRY ID: ________
     ADDRESS:    00207534          HEX OFFSET: _______________________________
     USE CONTENTS: _               ADD OFFSET: _____                       UDSA

                                                      CCSID TYPE: EBCDIC
    00000000 000 D5D4D94B 40C4C1E5 C9C440C1 C2C5D5C4 * NMR. DAVID ABEND * 00207534
    00000010 010 F4F5F640 D4C1C9D5 40E2E34B C8D6D4C5 * 456 MAIN ST.HOME * 00207544
    00000020 020 E3D6E6D5 D4C9F4F8 F0F1F000 950CF0F1 * TOWNMI48010.n.01 * 00207554
    00000030 030 F0F1F8F4 00001C00 002C1500 000C0300 * 0184............ * 00207564
    00000040 040 000C5B5B 5B404040 40404040 40404040 * ..$$$            * 00207574
    00000050 050 40404040 40404040 40404040 40404000 *                . * 00207584
    00000060 060 C9D4D94B 40D1D6C8 D540C4D6 C5404040 * IMR. JOHN DOE    * 00207594
    00000070 070 F8F9F740 E3E4D3C9 D7404040 C3C9E3E8 * 897 TULIP   CITY * 002075A4
    00000080 080 E3D6E6D5 D4C9F4F8 F0F1F185 000CF0F1 * TOWNMI48011e..01 * 002075B4
    00000090 090 F0F1F8F4 00001C00 002C1500 000C0300 * 0184............ * 002075C4
    000000A0 0A0 000CF0F4 F0404040 40404040 40404040 * ..040            * 002075D4
    000000B0 0B0 40404040 40404040 40404040 40404000 *                . * 002075E
    000000C0 0C0 00207534 40404040 40404040 40404040 * ..Í.             * 002075F4
    000000D0 0D0 40404040 40404040 40404040 40404040 *                  * 00207604
    000000E0 0E0 40404040 40404040 40404040 40404040 *                  * 00207614
    000000F0 0F0 40404040 40404040 40404040 40404040 *                  * 00207624

    From the Aggregate Length table (condensed from the actual listing) shown in the following figure, find the WORK_AREA structure. The structure shows the offsets and lengths of WA_RATE (3 bytes, offset 43) and WA_HOURS (3 bytes, offset 66).

    Aggregate Length Table

                    Aggregate Length Table
    Line.File Dims     Offset   Total Size    Base Size  Identifier


    125.1                  0           95           95 WORK_AREA
                           0                         1  WA_TYPE
                           1                        15  WA_NAME
                          16           27           27  WA_ADDRESS
                          16                        12   WA_STREET
                          28                         8   WA_CITY
                          36                         2   WA_STATE
                          38                         5   WA_ZIP
                          43                         3  WA_RATE
                          46            6            6  WA_DATE_EFF
                          46                         2   WA_DTEFF_MM
                          48                         2   WA_DTEFF_DD
                          50                         2   WA_DTEFF_YY
                          52                         3  WA_LST_PCT
                          55                         3  WA_TAX_RAT
                          58                         4  WA_YTD_GRS
                          62                         4  WA_YTD_TAX
                          66                         3  WA_HOURS
                          69                        26  WA_MSG

    Notice the offsets are shown in decimal format. To convert them to hex format, use the CALC command as follows:

     On the COMMAND line, type ?? 43 and press Enter to convert the offset for WA_RATE. The result is 2B in hex format.

     To find the hex offset of WA_HOURS, type ?? 66 and press Enter. The result is 42.

  3. To display the contents of your first multiplier (WA_RATE), tell Code Debug CICS where to look by typing +2B in the HEX OFFSET field. When you press Enter, the display is positioned at the first data item as shown in the following figure.

    Viewing Data Fields on the Memory Display Screen (2.2)

     -------------------------------- MEMORY DISPLAY (2.2) --------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
     MODULE: CWDEMPE  CSECT: CWDEMPE           COMPILED: 09 JUN 2005 - 11:23:48
    TABLE/AREA: ADDR                                 TABLE ENTRY ID: ________
     ADDRESS:    00207534          HEX OFFSET: _______________________________
     USE CONTENTS: _               ADD OFFSET: _____                       UDSA

                                                      CCSID TYPE: EBCDIC
    00000000 000 D5D4D94B 40C4C1E5 C9C440C1 C2C5D5C4 * NMR. DAVID ABEND * 00207534
    00000010 010 F4F5F640 D4C1C9D5 40E2E34B C8D6D4C5 * 456 MAIN ST.HOME * 00207544
    00000020 020 E3D6E6D5 D4C9F4F8 F0F1F000 950CF0F1 * TOWNMI48010.n.01 * 00207554
    00000030 030 F0F1F8F4 00001C00 002C1500 000C0300 * 0184............ * 00207564
    00000040 040 000C5B5B 5B404040 40404040 40404040 * ..$$$            * 00207574
    00000050 050 40404040 40404040 40404040 40404000 *                . * 00207584
    00000060 060 C9D4D94B 40D1D6C8 D540C4D6 C5404040 * IMR. JOHN DOE    * 00207594
    00000070 070 F8F9F740 E3E4D3C9 D7404040 C3C9E3E8 * 897 TULIP   CITY * 002075A4
    00000080 080 E3D6E6D5 D4C9F4F8 F0F1F185 000CF0F1 * TOWNMI48011e..01 * 002075B4
    00000090 090 F0F1F8F4 00001C00 002C1500 000C0300 * 0184............ * 002075C4
    000000A0 0A0 000CF0F4 F0404040 40404040 40404040 * ..040            * 002075D4
    000000B0 0B0 40404040 40404040 40404040 40404000 *                . * 002075E4
    000000C0 0C0 00207534 40404040 40404040 40404040 * ..Í.             * 002075F4
    000000D0 0D0 40404040 40404040 40404040 40404040 *                  * 00207604
    000000E0 0E0 40404040 40404040 40404040 40404040 *                  * 00207614
    000000F0 0F0 40404040 40404040 40404040 40404040 *                  * 00207624

    Important

    The displayed data area contains valid packed information (x'00950C').

  4. Display the contents of the second data item (WA_HOURS) by typing +42 in the cleared HEX OFFSET field. When you press Enter, the screen is positioned at the second data item as shown in the following figure.

    WA_HOURS Data Field on the Memory Display Screen (2.2)

     -------------------------------- MEMORY DISPLAY (2.2) --------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
     MODULE: CWDEMPE  CSECT: CWDEMPE           COMPILED: 09 JUN 2005 - 11:23:48
    TABLE/AREA: ADDR                                 TABLE ENTRY ID: ________
     ADDRESS:    00207534          HEX OFFSET: +00000042______________________
     USE CONTENTS: _               ADD OFFSET: _____                       UDSA

                                                      CCSID TYPE: EBCDIC
    00000042 000 5B5B5B40 40404040 40404040 40404040 * $$$              * 00207576
    00000052 010 40404040 40404040 40404040 4000C9D4 *              .IM * 00207586
    00000062 020 D94B40D1 D6C8D540 C4D6C540 4040F8F9 * R. JOHN DOE   89 * 00207596
    00000072 030 F740E3E4 D3C9D740 4040C3C9 E3E8E3D6 * 7 TULIP   CITYTO * 002075A6
    00000082 040 E6D5D4C9 F4F8F0F1 F185000C F0F1F0F1 * WNMI48011e..0101 * 002075B6
    00000092 050 F8F40000 1C00002C 1500000C 0300000C * 84.............. * 002075C6
    000000A2 060 F0F4F040 40404040 40404040 40404040 * 040              * 002075D6
    000000B2 070 40404040 40404040 40404040 40000020 *              ... * 002075E6
    000000C2 080 75344040 40404040 40404040 40404040 * Í.               * 002075F6
    000000D2 090 40404040 40404040 40404040 40404040 *                  * 00207606
    000000E2 0A0 40404040 40404040 40404040 40404040 *                  * 00207616
    000000F2 0B0 40404040 40404040 40404040 40404040 *                  * 00207626
    00000102 0C0 40404040 40404040 40404040 40404040 *                  * 00207636
    00000112 0D0 40404040 40404040 40404040 40404040 *                  * 00207646
    00000122 0E0 40404040 4040000C 0000000C 40404040 *       ......     * 00207656
    00000132 0F0 40404040 40404040 40404040 40404040 *                  * 00207666

    This time the displayed field contains bad data. The three-byte field contains 5B5B5B, otherwise known as $$$. This error caused the ASRA.

  5. Position the cursor on the bad data ($$$).
  6. Replace the bad data by typing a valid number, such as 040, over the data.
  7. Press Enter to update the change. The area contains valid data as shown in the following figure.

    Modifying Data on the Memory Display Screen (2.2)

    ---------------------------------- MEMORY DISPLAY (2.2) -------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
     MODULE: CWDEMPE  CSECT: CWDEMPE           COMPILED: 09 JUN 2005 - 11:23:48
    TABLE/AREA: ADDR                                 TABLE ENTRY ID: ________
     ADDRESS:    00207534          HEX OFFSET: +00000042______________________
     USE CONTENTS: _               ADD OFFSET: _____                       UDSA

                                                      CCSID TYPE: EBCDIC
    00000042 000 5B5B5B40 40404040 40404040 40404040 * 040              * 00207576
    00000052 010 40404040 40404040 40404040 4000C9D4 *              .IM * 00207586
    00000062 020 D94B40D1 D6C8D540 C4D6C540 4040F8F9 * R. JOHN DOE   89 * 00207596
    00000072 030 F740E3E4 D3C9D740 4040C3C9 E3E8E3D6 * 7 TULIP   CITYTO * 002075A6
    00000082 040 E6D5D4C9 F4F8F0F1 F185000C F0F1F0F1 * WNMI48011e..0101 * 002075B6
    00000092 050 F8F40000 1C00002C 1500000C 0300000C * 84.............. * 002075C6
    000000A2 060 F0F4F040 40404040 40404040 40404040 * 040              * 002075D6
    000000B2 070 40404040 40404040 40404040 40000020 *              ... * 002075E6
    000000C2 080 75344040 40404040 40404040 40404040 * Í.               * 002075F6
    000000D2 090 40404040 40404040 40404040 40404040 *                  * 00207606
    000000E2 0A0 40404040 40404040 40404040 40404040 *                  * 00207616
    000000F2 0B0 40404040 40404040 40404040 40404040 *                  * 00207626
    00000102 0C0 40404040 40404040 40404040 40404040 *                  * 00207636
    00000112 0D0 40404040 40404040 40404040 40404040 *                  * 00207646
    00000122 0E0 40404040 4040000C 0000000C 40404040 *       ......     * 00207656
    00000132 0F0 40404040 40404040 40404040 40404040 *                  * 00207666


    Now that you have corrected the data causing the error, you can continue with the test.

  8. Type =2.L in the COMMAND field and press Enter to return to the Source Listing screen.
  9. To position to the beginning of the actual statement, type GOTO +3262 (or GOTO 3140) in the COMMAND line and press Enter. This repositions the execution pointer to the beginning of the actual PL/I statement as shown in the following figure:

    Source Listing Screen (2.L) after using GOTO +3262 Command

     --------------------------------- SOURCE LISTING (2.L) -------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
     MODULE: CWDEMPE     ******************* GOTO OFFSET X'326A ********************
     ------   ----------------------------------------------- Before CWDEMPE.3140 ->
     003137   00003256 5812 1000                  L      1,X'
    000'(2,1)
     003138   0000325A 47F1 4000                  B      X'
    000'(1,4)
     003139   0000325E 47F0 4298                  B      X'
    298'(0,4)
     =====>   00003262 4820 4FCA                  LH     2,X'
    FCA'(0,4)
     003141   00003266 4122 D000                  LA     2,X'
    000'(2,13)
     003142   0000326A 5810 D1F4                  L      1,X'
    1F4'(0,13)
     003143   0000326E 4130 1042                  LA     3,X'
    042'(0,1)
     003144   00003272 F212 2000 3000             PACK   X'
    000'(2,2),X'000'(3,3)
     003145   00003278 D201 2002 2000             MVC    X'
    002'(2,2),X'000'(2)
     003146   0000327E D100 2003 5A01             MVN    X'
    003'(1,2),X'A01'(5)
     003147   00003284 F842 2004 102B             ZAP    X'
    004'(5,2),X'02B'(3,1)
     003148   0000328A FC41 2004 2002             MP     X'
    004'(5,2),X'002'(2,2)
     003149   00003290 F834 2009 2004             ZAP    X'
    009'(4,2),X'004'(5,2)
     003150   00003296 D203 D118 2009             MVC    X'
    118'(4,13),X'009'(2)
     003151   0000329C 5810 D1F4                  L      1,X'
    1F4'(0,13)
     003152   000032A0 F863 200D D118             ZAP    X'
    00D'(7,2),X'118'(4,13)
     003153   000032A6 FC62 200D 1037             MP     X'
    00D'(7,2),X'037'(3,1)
     003154   000032AC F846 2014 200D             ZAP    X'
    014'(5,2),X'00D'(7,2)
     003155   000032B2 D204 2019 2014             MVC    X'
    019'(5,2),X'014'(2)
     003156   000032B8 F040 2019 0FFF             SRP    X'
    019'(5,2),X'FFF'(1,0)
  10. To complete your test, re-execute line 837 by press PF12, or typing GO in the COMMAND line and pressing Enter. This time the transaction should not abend.

    The program finishes without further abends, concluding our exercise in sourceless debugging.

    Demonstration Transaction Screen

    *** COMPUWARE CORPORATION ***                                               C123
      DEMONSTRATION TRANSACTION

     EMPLOYEE NUMBER: 00001
     EMPLOYEE NAME:   MR. DAVID ABEND
     HOURS WORKED:    040
     HOURLY RATE:       9.50
     GROSS PAY:           380.00

    *** TRANSACTION COMPLETE ***


  11. Press Clear to return to CICS.
  12. On a blank CICS screen, type XPND and press Enter to end your debugging session.

 

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