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.

Analyzing the Data (Code Debug CICS PL/I)


  1. Press Clear.
  2. Type XPED CWDEMPE from a cleared CICS screen and press Enter to display the Source Listing screen (2.L). 
    The STATEMENT ANALYSIS area displays statistics for the last execution of CWDEMPE, as shown in the following figure:
    Showing Statistics For Analysis on the Source Listing Screen (2.L)

     --------------------- -------- SOURCE LISTING (2.L) ----------------------C024
    COMMAND ===>                                                   SCROLL ===> CSR
    MODULE: CWDEMPE  CSECT: CWDEMPE           COMPILED: 11 AUG 2006 - 10:51:01
    ------   --------------------------------------------------------------------->
    000361       CALL DFHENTRY_BF3CF5BF_B4ED7F82('   .  ................00000315' /
    000362    '02 06 80 00 03 05 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F0
    000363    0 F0 F0 F0 F3 F1 F5 'X */,L800_RETURN_TO_CICS);
    000364       END;
    000365
    000366       /* EXEC CICS ASSIGN
     000367                    SYSID(WS_SYSID)
     000368                    NOHANDLE  */

    000369       DO;
    000370       DCL DFHENTRY_BF3CF5BF_B50D4442 BASED(ADDR(DFHEI0)) OPTIONS(INTER A
    000371    EMBLER) ENTRY(*,*);
    000372       CALL DFHENTRY_BF3CF5BF_B50D4442('   .  ................000 0000002
    000373    '02 08 80 00 23 20 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 F0
    000374    0 F0 F0 F0 F3 F1 F8 'X */,WS_SYSID);
    000375       END;
    --------------------  S T A T E M E N T   A N A L Y S I S  --------------------
    STATEMENTS TO BE ANALYZED:    279          TOTAL ANALYZED COUNT: 2014
    ANALYZED STATEMENTS EXECUTED: 211          HIGHEST COUNT:        180
    ANALYZED STATEMENTS NOT EXEC: 68           HIGHEST COUNT STMT:   000528
    PERCENTAGE STATEMENTS EXEC:   75           LABEL:  L000_AUTOMATIC_VARS

    In this example, the statistics in the STATEMENT ANALYSIS area have changed to show the number of statements that were executed. 

    This area shows that 279 statements were set for analysis. Of these, 211 were executed and 68 were not. The 211 statements were executed a total of 2014 times (TOTAL ANALYZED COUNT), with one executing 180 times (HIGHEST COUNT). This indicates a loop in the program. HIGHEST COUNT STMT points to the statement number where the loop occurred. LABEL shows the name of the paragraph that contains that statement.

    Also note that the COUNT parameters have changed. The first statement was executed twice: once to send the initial XPLE screen and once to process the information on that screen.

  3. Type L 1048 in the COMMAND field to locate statement 1048 (statement number just before where the loop occurred) and press Enter to see where and why the storage violation took place.

Browsing Source Code on the Source Listing Screen (2.L)

 --------------------------------- SOURCE LISTING (2.L) -------------------C024
COMMAND ===>                                                   SCROLL ===> CSR
MODULE: CWDEMPE  CSECT: CWDEMPE           COMPILED: 11 AUG 2006 - 10:51:01
------   --------------------------------------------------------------------->
001048       DO BAD_SUBSCRIPT = 1 TO 24 ;                               0000001
001049          STOR_VIOLATION (BAD_SUBSCRIPT) = '?' ;                  0000024
001050       END ;                                                      0000024
001051
001052
001053       MAP2_LINE5_R = STOR_VIOLATION_MSG ;                        0000001
001054
001055    L1200_SEND_MAP:                                               0000001
001056       MAP2_LINE4  = ' ' ;
001057       MAP2_LINE6_R,MAP2_LINE7_R,MAP2_LINE8_R = ' ' ;             0000001
001058
001059    SEND_PAYMAP2:                                                 0000001
001060
001061       PAYMSG =  '*** TRANSACTION COMPLETE ***' ;
001062       PAYSID2 = WS_SYSID ;                                       0000001
--------------------  S T A T E M E N T   A N A L Y S I S  --------------------
STATEMENTS TO BE ANALYZED:    279          TOTAL ANALYZED COUNT: 2014
ANALYZED STATEMENTS EXECUTED: 211          HIGHEST COUNT:        180
ANALYZED STATEMENTS NOT EXEC: 68           HIGHEST COUNT STMT:   000528
PERCENTAGE STATEMENTS EXEC:   75           LABEL:  L000_AUTOMATIC_VARS

In this case, the storage violation occurred because the subscript is being checked for a maximum value greater than 24, while the table has only 16 entries.

You can use the FIND COUNT command to browse through the source listing and examine the COUNT associated with each statement. You can also use the SHOW COUNT command to display the lines selected for analysis. By looking at these counts, you can easily see how your program is processing. If Code Debug’s trace function has been activated, you can also view the Program Trace screen (2.4) to review the logic flow.

You can reset the analysis by entering a new COUNT command. It can be turned OFF by entering the DELETE COUNT command.

You can also use the COUNT command to check the overall efficiency of your program. Use the COUNT ALL command to set up an analysis for the entire program, then execute each logic path in the program without resetting the analysis. Review the STATEMENT ANALYSIS to determine if any code has not been executed. By leaving the analysis active and executing all logic paths in the program, you can easily pinpoint code that was not executed.

Remember to end the session as described in Exiting Code Debug CICS and Ending a Debugging Session for PL/I.

 

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