Before proceeding, be sure you have completed the steps outlined in Advanced Demo Preliminaries in this appendix and you have the Initial Intercept for CAMRPLI displayed on your screen.
Note: CAMRPLI is an ISPF application.
Now you are going to set unconditional breakpoints at a number of procedure names in the demo program. In the basic demo you set an unconditional breakpoint using the u line command, which is equivalent to the UNCOND command. However, a quicker way to include unconditional breakpoints for a test session is to place the breakpoint commands in a data set member, and simply include that member when the Initial Intercept panel displays.
The PLIINCL data set member of CAI.CAISRC contains the commands that set the breakpoints required for using the Advanced Options Demo for PL/I. Include this data set member as follows:
|
Action: |
Enter the following command at the *Initial* Intercept panel: include pliincl Press Enter. |
|
Result: |
The application processes the commands in the pliincl data set, and returns the following message in the upper-right corner of the screen: BREAKPOINT SET. |
CAMRPLI ---------- CA InterTest™ Batch *INITIAL* Intercept ----- BREAKPOINT SET COMMAND ===> SCROLL ===> CUR TRACE=> 000001 *************************** Top of Data ******************************** SOURCE LISTING STMT LEV NT *--> 1 0 CAMRPLI: PROC OPTIONS (MAIN); /*------------------------------------------------*/ /* Welcome to the CA InterTest™ Batch */ /* PL/I demonstration program. You are now at the */ /* Initial Breakpoint panel which is displayed */ /* upon entry to the first program to be tested. */ /* At this point, other breakpoints can be set */ /* and control commands can be issued before the */ /* program is executed. */ /*------------------------------------------------*/ 2 1 0 DCL REPORT FILE RECORD SEQUENTIA ENV (F, RECSIZE(80)); 3 1 0 DCL 1 LINE_OUT, 3 ASA_CNTL CHAR(1),
After setting the required breakpoints, you can access the Demo Session Options Menu by executing the demo program and choosing the Advanced Options Menu from the Welcome panel. Use the following steps:
|
Action: |
From the Initial Intercept panel, type GO and press Enter to execute the program. |
|
Result: |
The demo program begins execution and displays the Welcome panel. |
The Welcome Screen is shown next:
****************************************************************************** ****************************************************************************** ***** ***** ***** Welcome to the CA InterTest™ Batch Demo Session ***** ***** ***** ***** ***** ***** Before proceeding, please have on hand the User Guide ***** ***** which accompanies the Demo Session. ***** ***** ***** ***** In this Demo, we will debug a PL/I program which is ***** ***** included with CA InterTest™ Batch. ***** ***** ***** ***** ***** ***** To continue the Basic Demo, press ENTER. ***** ***** ***** ***** To access the Options Menu, press PF2. ***** ***** ***** ***** ***** ***** ENTER Basic Demo PF2 Advanced Options Menu PF3 Exit Demo ***** ****************************************************************************** ******************************************************************************
|
Action: |
Press PF2 to access the Options Menu for the Advanced Demo Session. |
|
Result: |
The Advanced Options Preliminary Screen displays, reminding you not to access the Options Menu without including the data set member PLIINCL. |
A sample Options Menu Preliminaries screen follows:
********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Options Menu ***** ***** Preliminaries ***** ***** ***** ********************************************************************** To use the Demo Options, you must first issue the command "INCLUDE PLIINCL", as described in the User Guide. If you have completed this step, press ENTER to go to the Options Menu. If you have not completed this step, press PF3 to terminate the demo and refer to the "Advanced Demo Preliminaries" section of the guide.
|
Action: |
Press Enter to continue. |
|
Result: |
The Demo Session Options Menu displays. |
A sample Demo Session Options Menu follows:
********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Options Menu ***** ***** ***** ********************************************************************** 1 Time-driven execution ( SLOW command and KEEP windows ) 2 Conditional Breakpoints ( Pseudo-code ) 3 Update Source code ( Splitting the screen ) 4 Interrupt a program loop ( SKIP command ) 5 Trace execution ( PREV & ADVANCE Commands ) 6 Work with indexed tables ( SET command ) 7 Histogram report ( Report identifying dead code ) Key in request: Press ENTER to continue or PF3 to terminate.
Each of the options on the menu is independent and can be performed in any order. To use an option, follow the appropriate section in this guide. Upon completing an option, you return to the Menu.
Before you start, you should know that:
To interrupt a loop-press the ATTN or PA1 key. Try the ATTN key first. If that does not interrupt the loop, your testing environment requires you to use the PA1 key. If using PA1, you may need to press RESET first.
You can exit the demo from the Options Menu at any time.
|
Action: |
Press PF3. |
|
Result: |
The End Demo Session screen displays.
|
|
Action: |
Press Enter. |
|
Result: |
The Program Breakpoint Intercept panel displays for an unconditional breakpoint at label RETURN_TO_OPSYS. (This breakpoint was set by a command in the PLIINCL include file.)
|
|
Action: |
Type GO and press Enter to execute the program. |
|
Result: |
The demo program ends, and the Entry panel displays. |
If you exit the demo, you can return at any time to perform another advanced option. Just repeat the preliminary steps given in the beginning of this chapter. Remember to enter the following command at the Initial Breakpoint screen:
include pliincl
This option illustrates how you can slow the execution of your program. The SLOW command executes one statement in your program every few seconds. The exact time interval is specified when you issue the SLOW command. Using the SLOW command together with a keep window is an especially effective testing technique; it lets you halt the program whenever you see a problem, without having to determine the breakpoint in advance.
Note: Before proceeding, be sure you have completed the steps outlined in Advanced Demo Preliminaries in this appendix and you have the Demo Session Options Menu displayed on your screen.
This option requires you to interrupt the program by pressing the ATTENTION key or the PA1 key. Before proceeding, locate each of these keys on your keyboard. If you need help in finding them, ask a technical support person before you begin.
|
Action: |
Key in Option 1. Press Enter. |
|
Result: |
CAMRPLI displays the screen that describes what occurs in this part of the demo session. |
A sample screen showing Option 1: Time-Controlled Statement Execution follows:
********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Time-controlled statement execution ***** ***** ***** ********************************************************************** This feature shows you the advantages of using the SLOw command. SLOw resumes execution of your program one verb at a time at an interval specified by you. This command is especially effective when used in conjunction with the Keep window. Here is what will happen: 1. CA InterTest™ Batch halts the DEMO program at an unconditional breakpoint 2. You open a Keep window and then issue the SLOw command. 3. CA InterTest™ Batch slowly executes the DEMO program at a rate of one verb every 2 seconds. 4. You will regain control by pressing an attention key. Press ENTER to continue or PF3 to return to the Options Menu.
|
Action: |
Press Enter. |
|
Result: |
The application halts CAMRPLI at an unconditional breakpoint set at procedure PAY_CALC. The procedure statement is highlighted. |
Open a keep window that displays the values of YTD and X_AXIS_YTD by entering the commands specified below. Notice how you can use the short form of the keep command (k) and use the TSO command delimiter (normally a semi-colon) to string multiple commands on a single command line.
|
Action: |
Key in the following command: k ytd; k x_axis_ytd |
|
Result: |
The application displays a keep window showing the current values of YTD and X_AXIS_YTD. |
A sample screen showing the keep window for YTD and X_AXIS_YTD follows:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000168 000094 000093 000092 000091 000088 000087 000086 000085 000084 0 ------------------------------------------------------------------------- 1F1A84EF NP-S 000090 02 YTD +0000000.00 1F1A84F7 AN 000089 03 X_AXIS_YTD ------------------------------------------------------------------------- U---> 168 1 0 PAY_CALC: PROC ( I ); 169 2 0 DCL I PIC '999'; 170 2 0 DCL J FIXED BIN(15); ---> 171 2 0 DO J = 1 TO I BY 1; ---> 172 2 1 CALL POPULATE_GRAPH ( J ); ---> 173 2 1 END; /* CHEQUE_LINE = ' '; */ ---> 174 2 0 CHEQUE_AMOUNT = TOTALGROSS; ---> 175 2 0 RETURN; ---> 176 2 0 END PAY_CALC;
Issue the SLOW command to execute one statement every two seconds. As the program resumes execution, you are able to see the changing values of YTD and X_AXIS_YTD. In this demo, you are going to halt execution when the X_AXIS_YTD value is MAR by pressing the ATTENTION key.
|
Action: |
Key in the command: slow 2 Press Enter. |
|
Result: |
The application initiates a time-controlled execution of CAMRPLI, at a rate of one statement every two seconds. |
|
Action: |
When the value of X_AXIS_YTD in the keep window is MAR, press the ATTN or PA1 key. Try the ATTN key first. |
|
Result: |
The Attention Intercept panel displays, as shown in the following panel. |
A sample Attention Intercept panel follows:
CAMRPLI ---------- CA InterTest™ Batch ATTENTION Intercept ------------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000185 000184 000183 000182 000177 000172 000173 000186 000185 000184 0 ------------------------------------------------------------------------- 1F1A84EF NP-S 000090 02 YTD +0256273.52 1F1A84F7 AN 000089 03 X_AXIS_YTD MAR ------------------------------------------------------------------------- 0003 182 2 0 X_AXIS_YTD = MONTH_ITEM ( I ); 0003 183 2 0 X_AXIS_R ( I ) = TOKEN_ITEM; 0003 184 2 0 YTD = YTD + MONTHLY_AMOUNT 0002 185 2 0 TOTALGROSS = YTD; 0002 186 2 0 RETURN; ---> 187 2 0 END POPULATE_GRAPH; ---> 188 1 0 BILL_CALC: PROC; 189 2 0 DCL I FIXED BIN(15); 190 2 0 DCL 1 BILLS_BILLS_BILLS, 3 BILLS_MONTHLY, 5 BILLING_AMOUNT (12) FIXED DEC(7,2) INIT
Review what you just did.
This combination of using keep windows, the slow command, and an Attention Intercept lets you carefully control and monitor your program execution, while tracking the values of specific variables.
Note: The Attention Intercept panel is only displayed when the user presses the ATTN or PA1 key and then the application executes a statement in a program that is currently being monitored.
Before returning to the Options Menu of the advanced demo, remove the keep window as follows:
|
Action: |
Key in the command: remove all Press Enter. |
|
Result: |
The application removes the keep window for YTD and X_AXIS_YTD on the Attention Intercept panel. |
|
Action: |
Type GO and press Enter to continue execution. |
|
Result: |
CAMRPLI resumes execution, and displays the Options Menu. |
This concludes Option 1: Time Controlled Execution. Select another option and go to the appropriate section in this guide, or exit the demo using PF3.
This option shows you how to set and use conditional breakpoints.
Note: Before proceeding, be sure you have completed the steps outlined in Advanced Demo Preliminaries in this appendix and you have the Demo Session Options Menu displayed on your screen.
|
Action: |
Key in Option 2. Press Enter. |
|
Result: |
CAMRPLI displays the screen that describes what occurs in this part of the demo session: |
********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Conditional Breakpoints ***** ***** ***** ********************************************************************** Conditional Breakpoints are one of the most powerful features at your disposal. CA InterTest™ Batch will automatically halt your program's execution only if a certain condition you specified becomes true. This is what will happen: 1. CA InterTest™ Batch halts the DEMO program at an unconditional breakpoint 2. You issue the COND or When command and display the conditional breakpoint menu. 3. You enter the condition under which you wish execution to be halted and you specify the pseudo-code you want executed at the breakpoint. Press ENTER to continue or PF3 to return to the Options Menu.
|
Action: |
Press Enter. |
|
Result: |
The application halts CAMRPLI at an unconditional breakpoint. The statement at the breakpoint is highlighted. |
Access the screen used to set conditional breakpoints. From this screen, you can set both the conditions and any commands you want executed when the specified condition is met.
|
Action: |
Key the following in the Command field: cond Press Enter. |
|
Result: |
The When panel displays. WHEN is a synonym for COND. |
A sample When panel to set unconditional breakpoint follows:
------------------- CA InterTest™ Batch WHEN PANEL ---------------------------- OPTION ===> S - SET A WHEN CONDITION R - RESET A WHEN CONDITION L - OR BLANK, LIST THE WHEN CONDITIONS SPECIFY DATA AREA NAME(S) AND COMPARISON CONDITION: WHEN-NAME ===> DATA-AREA-1 ===> OPERATOR ===> (EQ, NE, LT, GT, LE, GE, =, <>, <, >, <=, >=) DATA-AREA-2 ===> AFTER ===> N (Y/N) COMMANDS TO BE EXECUTED AT WHEN CONDITION: ===>
|
Action: |
Make the following entries on the When panel: Press Enter. |
----------------------- CA InterTest™ Batch WHEN PANEL ------------------------- OPTION ===>S S - SET A WHEN CONDITION R - RESET A WHEN CONDITION L - OR BLANK, LIST THE WHEN CONDITIONS SPECIFY DATA AREA NAME(S) AND COMPARISON CONDITION: WHEN-NAME ===> ytdcond DATA-AREA-1 ===> subtotal OPERATOR ===> ge (EQ, NE, LT, GT, LE, GE, =, <>, <, >, <=, >=) DATA-AREA-2 ===> 600.00 AFTER ===> N (Y/N) COMMANDS TO BE EXECUTED AT WHEN CONDITION: ===> k subtotal; set totalgross = 2000; k totalgross
|
Result: |
The application displays the following message in the top right corner of the When panel: WHEN CONDITION SET. |
|
Action: |
Press PF3 to exit the When panel. |
|
Result: |
The application brings you to the previous Breakpoint Intercept panel. |
|
Action: |
Continue execution by typing GO and pressing Enter. |
|
Result: |
CAMRPLI resumes execution until the condition you set for the YTDCOND breakpoint is met; when the value of SUBTOTAL is greater than or equal to 600, CA InterTest™ Batch halts execution, and executes the commands you entered for the conditional breakpoint; it displays a keep window for SUBTOTAL, sets TOTALGROSS to 2000, and then displays TOTALGROSS in the keep window. Your screen should look like the Intercept panel in the following screen. |
A sample intercept panel showing condition YTDCOND has been met follows:
CAMRPLI ---------- CA InterTest™ Batch WHEN YTDCOND BEFORE Intercept --------- COMMAND ===> SCROLL ===> CUR TRACE=> 000193 000192 000194 000193 000192 000194 000193 000192 000191 000188 0 ------------------------------------------------------------------------- 1F1A84E6 NP-S 000101 02 SUBTOTAL +00971.68 1F1A84EA NP-S 000090 02 TOTALGROSS +0002000.00 ------------------------------------------------------------------------- 0003 192 2 1 SUBTOTAL = SUBTOTAL + BILLING_A 0002 193 2 1 BILL_YTD = SUBTOTAL; 0002 194 2 1 END; ---> 195 2 0 RETURN; ---> 196 2 0 END BILL_CALC; ---> 197 1 0 INITIALIZE_TABLE: PROC; 198 2 0 DCL (I, J) FIXED BIN(15); ---> 199 2 0 DO I = 1 TO 2; ---> 200 2 1 DO J = 1 TO 9; ---> 201 2 2 STATE_NUMBER ( I ) = I; 5688-235 IBM PL/I for MVS & VM CAMRPLI: PROC OPTIONS (MAIN); STMT LEV NT ---> 202 2 2 COUNTY_NUM1 ( I, J ) = I;
Now remove the conditional breakpoint before continuing.
|
Action: |
Return to the When panel by entering the command: when Press Enter. |
|
Result: |
The When panel displays. |
|
Action: |
Key in the following on the When panel: Press Enter |
----------------------- CA InterTest™ Batch WHEN PANEL ------------------------- OPTION ===>R S - SET A WHEN CONDITION R - RESET A WHEN CONDITION L - OR BLANK, LIST THE WHEN CONDITIONS SPECIFY DATA AREA NAME(S) AND COMPARISON CONDITION: WHEN-NAME ===> ytdcond DATA-AREA-1 ===> OPERATOR ===> (EQ, NE, LT, GT, LE, GE, =, <>, <, >, <=, >=) DATA-AREA-2 ===> AFTER ===> N (Y/N) COMMANDS TO BE EXECUTED AT WHEN CONDITION: ===>
|
Result: |
The application displays the following message in the top right corner of the When panel: WHEN DELETED. |
|
Action: |
Press PF3 to exit the When panel. |
|
Result: |
The application brings you to the previous Intercept panel. |
Remove the keep window before continuing execution.
|
Action: |
Key in the following command: remove all Press Enter. |
|
Result: |
The keep window is removed. |
Return to the Options Menu by continuing execution.
|
Action: |
Type GO and press Enter. |
|
Result: |
CAMRPLI resumes execution and displays the Options Menu. |
This concludes Option 2: Conditional Breakpoints. Select another option and go to the appropriate section in this guide, or exit the demo using PF3.
This option illustrates how you can use the ISPF split-screen capability from any screen. One way to use this feature is to update your source code as soon as you find errors during your test session.
Note: Before proceeding, be sure you have completed the steps outlined in Advanced Demo Preliminaries in this appendix and you have the Demo Session Options Menu displayed on your screen.
|
Action: |
Key in Option 3. Press Enter. |
|
Result: |
CAMRPLI displays the screen that describes what occurs in this part of the demo session. |
A sample Option 3: Updating Source Code follows:
********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Updating Source Code ***** ***** ***** ********************************************************************** Because CA InterTest™ Batch is ISPF-compliant, at any time during your testing you can SPLIT your screen and engage another ISPF logical session. This enables you to update your source code with fixes as you find them. 1. CA InterTest™ Batch halts the DEMO program at an unconditional breakpoint. 2. You SPLIT the screen using the SPLIT PF key as defined in your profile. Press ENTER to continue or PF3 to return to the Options Menu.
|
Action: |
Press Enter. |
|
Result: |
The application halts CAMRPLI at an unconditional breakpoint at the label SPLIT_SCREEN. |
|
Action: |
Tab about halfway down your screen and press the SPLIT PF key defined in your ISPF profile (normally PF2). |
|
Result: |
The ISPF Primary Option Menu displays in the bottom half of your screen. |
A sample showing using a split-screen from an Intercept panel follows:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000109 000108 000107 000106 000105 000078 000077 000076 000075 000074 0 U---> 109 1 0 SPLIT_SCREEN: GO TO OPTIONS; /*------------------------------------------------*/ /* FROM THIS UNCONDITIONAL BREAKPOINT YOU CAN */ /* PRESS THE PF KEY ASSIGNED TO THE SPLIT COMMAND */ /* WHICH TAKES YOU TO THE ISPF MAIN MENU. */ /*------------------------------------------------*/ . . . . . . . . . . . . . . . . . . . . . . . . . . . CA Islandia Data Center USER01 OPTION ===> CCCCCCCCCCCCCCCCCCCCCCCC CATSO CCCCCCCCCCCCCCCCCCCCCCCC 06/05/02 CCCC 14:09 C CA Products CCCC XAD1 D SVC Dump Index CCCC AAAAAAA G Color Graphics Terminal Products CCCC AAAAAAAAA P Program Development Facility CCCC AAAA AAAA
If you had found an error in your program code, you can use ISPF to access and edit your source code before continuing with your test session.
For example, in the basic demo, the application stopped execution of the program because it detected an S0C7 ABEND. You were able to continue execution by dynamically changing the value of Tasknum to zero. This was a one-time patch. To correct the problem, you need to update your source code so that Tasknum is properly initialized. You can do this from any Intercept panel by splitting your screen to edit your source code.
|
Action: |
Remove your ISPF split-screen using the command: =x |
|
Result: |
You return to a full-screen display of the unconditional breakpoint shown in the previous panel. |
|
Action: |
Type GO and press Enter to continue execution. |
|
Result: |
You return to the Demo Options Menu. |
This concludes Option 3: Update Source Code. Select another option and go to the appropriate section in this guide, or exit the demo using PF3.
This option illustrates how to interrupt and verify that you have a looping program. It also illustrates the use of the skip command.
Note: Before proceeding, be sure you have completed the steps outlined in Advanced Demo Preliminaries in this appendix and you have the Demo Session Options Menu displayed on your screen.
This option requires you to interrupt the program by pressing the ATTENTION key or the PA1 key. Before proceeding, locate each of these keys on your keyboard. If you need help, ask a technical support person before you begin.
|
Action: |
Key in Option 4. Press Enter |
|
Result: |
CAMRPLI displays the screen that describes what occurs in this part of the demo session. |
A sample screen of Option 4: Interrupt a looping program follows:
********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Interrupt a looping program ***** ***** ***** ********************************************************************** CA InterTest™ Batch allows you to interrupt programs in tight loops. Using the FREQuency counter you can trace the bug that causes a loop and then fix it by dynamically changing your program's executable code - without a re-compilation !! 1. CA InterTest™ Batch halts the DEMO program at an unconditional breakpoint. 2. You will allow the program to loop. 3. You interrupt the loop using an attention key. 4. Using Keep windows and the statement Skip feature you will fix the bug by modifying the executable code. Press ENTER to continue or PF3 to return to the Options Menu.
|
Action: |
Press Enter. |
|
Result: |
The application halts CAMRPLI at an unconditional breakpoint set at ORDER_CALC. |
A sample screen showing CAMRPLI stopped at ORDER_CALC follows:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000134 000133 000132 000131 000130 000079 000078 000077 000076 000075 0 U---> 134 1 0 ORDER_CALC: /*------------------------------------------------*/ /* THIS SECTION OF THE DEMO SHOWS YOU HOW TO */ /* INTERRUPT A LOOPING PROGRAM AND CHANGE THE */ /* EXECUTION LOGIC WITHOUT RE-COMPILATION. */ /*------------------------------------------------*/ LOOP_OUT = 0; ---> 135 1 0 CALL TOTAL_ORDER ( ); ---> 136 1 0 GO TO OPTIONS; ---> 137 1 0 DEMONSTRATE_HIST_COMMAND: /*------------------------------------------------*/ /* THIS SECTION OF THE DEMO SHOWS YOU HOW TO */ /* ISSUE THE HISTOGRAM COMMAND. */ /*------------------------------------------------*/
Note: If the Frequency Counter arrows and numbers are not displayed along the left side of your screen, turn the frequency display on by entering the command: freq.
|
Action: |
Continue execution by typing GO and pressing Enter. |
|
Result: |
CAMRPLI resumes execution. |
Notice the system light remains on. There are additional breakpoints and screen panels in the demo program code, yet all you see is the system light. This is symptomatic of a looping program. Halt the program to see what is going on.
|
Action: |
Press the ATTN or PA1 key. Try the ATTN key first. If that does not work, your testing environment requires you to use the PA1 key. Press RESET before pressing the PA1 key to unlock the terminal keyboard. |
|
Result: |
The Attention Intercept panel displays. |
Continue with the Continuing from the Attention Routine section.
Note: If you do not successfully stop execution with the ATTN or PA1 key before 20,000 executions of the demo program loop, you reach a safety net conditional breakpoint. If you reach this breakpoint, instructions for continuing are given in the Continuing from the "Safety Net" Conditional Breakpoint section.
Follow this section only if you see the breakpoint in the following panel. If you do not, continue with the Continuing from the Attention Routine section.
A sample screen showing a Safety Net Conditional Breakpoint of a Demo Loop follows:
CAMRPLI ---------- CA InterTest™ Batch WHEN LOOPCOND BEFORE Intercept -------- COMMAND ===> SCROLL ===> CUR TRACE=> 000219 000218 000217 000216 000221 000220 000219 000218 000217 000216 0 ------------------------------------------------------------------------- 227A93FA NP-S 000210 ITEM_TOTAL +0000969.00 227A941A NP-S 000213 04 UNIT_PRICE +00080.75 I (+2) 227A941E NP-S 000213 04 NO_OF_WIDGETS +0000012. I (+2) ------------------------------------------------------------------------- 020K 217 2 1 I = I + 1; 020K 218 2 1 LOOP_OUT = LOOP_OUT + 1; 020K 219 2 1 ITEM_TOTAL = UNIT_PRICE ( I ) * NO_OF_WIDGETS ( I ); 5688-235 IBM PL/I for MVS & VM CAMRPLI: PROC OPTIONS (MAIN); STMT LEV NT 020K 220 2 1 I = 1; 020K 221 2 1 ORDER_SUB_TOTAL = ORDER_SUB_TOTAL + IT 222 2 1 END; U---> 223 2 0 TOTAL_ORDER_EX: RETURN;
To continue with the looping program demo, you must press the ATTN or PA1 key before 20,000 executions of the loop this time. To continue the program loop, use the following steps:
Note: Even if PA1 stopped the slow execution in option 1, you may need to press ATTN to stop a loop.
You should see the Attention Intercept panel.
To return to the Options Menu:
Note: This compiler is an optimizing compiler. Therefore, an abend is possible using the GO <label> command. If this happens, you can return to the Options Menu by restarting the demo application.
You return to the Options Menu. You can try the same option again, even if you did not complete it the first time, or select another option from the menu.
The application now displays the Attention Intercept panel. A sample showing an Attention Intercept in procedure TOTAL_ORDER follows:
CAMRPLI ---------- CA InterTest™ Batch ATTENTION Intercept ------------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000221 000220 000219 000218 000217 000216 000221 000220 000219 000218 0 013K 220 2 1 I = 1; 013K 221 2 1 ORDER_SUB_TOTAL = ORDER_SUB_TOTAL + IT 222 2 1 END; U---> 223 2 0 TOTAL_ORDER_EX: RETURN; ---> 224 2 0 END TOTAL_ORDER; ---> 225 1 0 PROPAGATE: PROC; 226 2 0 DCL I FIXED BIN(15) INIT( 227 2 0 DCL TABLE_SUB FIXED BIN(15) INIT( 228 2 0 DCL 1 TABLE_OF_SORTS, 3 TABLE_ELEMENT (60) CHAR(1); ---> 229 2 0 DO I = 1 TO 17; ---> 230 2 1 TABLE_SUB = INCREMENT ( TABLE_SU ---> 231 2 1 TABLE_ELEMENT ( TABLE_SUB ) = '+'; ---> 232 2 1 TABLE_SUB = INCREMENT ( TABLE_SU
CAMRPLI keeps executing the TOTAL_ORDER procedure, as you can see from your Attention Intercept screen display. The current statement is highlighted.
Look at the frequency counters to the left of the program statements. They show repeated execution of the TOTAL_ORDER statements, indicating a loop. To investigate the logic in TOTAL_ORDER, you can set a keep window for I and then execute slowly using the SLOW command. This time you use the abbreviated form of the keep command: k.
|
Action: |
Key in the following command to set the keep window: k i Press Enter. |
|
Result: |
The application displays a keep window for the variable I. |
A sample screen showing the keep window to View I follows:
CAMRPLI ---------- CA InterTest™ Batch ATTENTION Intercept ------------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000221 000220 000219 000218 000217 000216 000221 000220 000219 000218 0 ------------------------------------------------------------------------- 1F1A93F2 NB-S 000209 I +1. ------------------------------------------------------------------------- 013K 220 2 1 I = 1; 013K 221 2 1 ORDER_SUB_TOTAL = ORDER_SUB_TOTAL + IT 222 2 1 END; U---> 223 2 0 TOTAL_ORDER_EX: RETURN; ---> 224 2 0 END TOTAL_ORDER; ---> 225 1 0 PROPAGATE: PROC; 226 2 0 DCL I FIXED BIN(15) INIT( 227 2 0 DCL TABLE_SUB FIXED BIN(15) INIT( 228 2 0 DCL 1 TABLE_OF_SORTS, 3 TABLE_ELEMENT (60) CHAR(1); ---> 229 2 0 DO I = 1 TO 17;
|
Action: |
Key in the following command to execute one CAMRPLI statement every two seconds: slow 2 Press Enter. |
|
Result: |
CAMRPLI continues a slow execution. As the code executes, you can see the code looping, and you can see the corresponding value of I in the keep window. |
The following sample screen of a SLOW 2 Execution shows a Loop and I problem:
CAMRPLI ---------- CA InterTest™ Batch STEP BEFORE Intercept ----------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000220 000219 000218 000217 000216 000221 000220 000219 000218 000217 0 ------------------------------------------------------------------------- 1F1A93F2 NB-S 000209 I +2. ------------------------------------------------------------------------- 013K 216 2 0 DO UNTIL (I = ORDER_ITEMS); 013K 217 2 1 I = I + 1; 013K 218 2 1 LOOP_OUT = LOOP_OUT + 1; 013K 219 2 1 ITEM_TOTAL = UNIT_PRICE ( I ) * NO_OF_WIDGETS ( I ); 5688-235 IBM PL/I for MVS & VM CAMRPLI: PROC OPTIONS (MAIN); STMT LEV NT 013K 220 2 1 I = 1; 013K 221 2 1 ORDER_SUB_TOTAL = ORDER_SUB_TOTAL + IT 222 2 1 END; U---> 223 2 0 TOTAL_ORDER_EX: RETURN; ---> 224 2 0 END TOTAL_ORDER;
Notice that I changes from 1 to 2, but back to 1 again. I is being reset to 1, and causing the program to loop. The value of I is causing the TOTAL_ORDER procedure to continue to be executed.
|
Action: |
Halt execution again by pressing the ATTENTION or PA1 key. After the Attention Routine message displays, press Enter. |
|
Result: |
The application brings you to another Attention Intercept panel. The current statement is highlighted. |
To dynamically correct the loop-condition, you could use the SKIP command to bypass the offending statement. The s line command is another form of the SKIP command.
|
Action: |
Tab down to the statement: I = 1, and key an s to the left of the line. |
The following sample screen shows using skip to bypass the cause of the loop:
CAMRPLI ---------- CA InterTest™ Batch ATTENTION Intercept ------------------- COMMAND ===> SCROLL ===> CSR TRACE=> 000219 000218 000217 000216 000221 000220 000219 000218 000217 000216 0 ------------------------------------------------------------------------- 1F1A93F2 NB-S 000209 I +2. ------------------------------------------------------------------------- 013K 216 2 0 DO UNTIL (I = ORDER_ITEMS); 013K 217 2 1 I = I + 1; 013K 218 2 1 LOOP_OUT = LOOP_OUT + 1; 013K 219 2 1 ITEM_TOTAL = UNIT_PRICE ( I ) * NO_OF_WIDGETS ( I ); 5688-235 IBM PL/I for MVS & VM CAMRPLI: PROC OPTIONS (MAIN); STMT LEV NT S013K 220 2 1 I = 1; 013K 221 2 1 ORDER_SUB_TOTAL = ORDER_SUB_TOTAL + IT 222 2 1 END; U---> 223 2 0 TOTAL_ORDER_EX: RETURN; ---> 224 2 0 END TOTAL_ORDER;
|
Result: |
The application skips the statement that sets I to 1, and executes the code as if the statement was removed. |
|
Action: |
Tab up to the second statement in the DO loop, I = I + 1, and type a g to the left of the line, to continue execution from that point Your entry should match the following panel. The following sample screen shows a continuing execution from the add statement: |
CAMRPLI ---------- CA InterTest™ Batch NEXT BEFORE Intercept --- BREAKPOINT SET COMMAND ===> SCROLL ===> CSR TRACE=> 000219 000218 000217 000216 000221 000220 000219 000218 000217 000216 0 ------------------------------------------------------------------------- 1F1A93F2 NB-S 000209 I +2. ------------------------------------------------------------------------- 013K 216 2 0 DO UNTIL (I = ORDER_ITEMS); g013K 217 2 1 I = I + 1; 013K 218 2 1 LOOP_OUT = LOOP_OUT + 1; 013K 219 2 1 ITEM_TOTAL = UNIT_PRICE ( I ) * NO_OF_WIDGETS ( I ); 5688-235 IBM PL/I for MVS & VM CAMRPLI: PROC OPTIONS (MAIN); STMT LEV NT S013K 220 2 1 I = 1; 013K 221 2 1 ORDER_SUB_TOTAL = ORDER_SUB_TOTAL + IT 222 2 1 END; U---> 223 2 0 TOTAL_ORDER_EX: RETURN; ---> 224 2 0 END TOTAL_ORDER;
|
|
Press Enter. |
|
Result: |
CAMRPLI resumes execution from the line where you entered the g, and continues execution until it reaches the next unconditional breakpoint, as shown in the following panel. |
The following sample screen shows an unconditional breakpoint at TOTAL_ORDER_EX:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000223 000221 000219 000218 000217 000216 000221 000219 000218 000217 0 ------------------------------------------------------------------------- 1F1A93F2 NB-S 000209 I +5. ------------------------------------------------------------------------- 013K 216 2 0 DO UNTIL (I = ORDER_ITEMS); 013K 217 2 1 I = I + 1; 013K 218 2 1 LOOP_OUT = LOOP_OUT + 1; 013K 219 2 1 ITEM_TOTAL = UNIT_PRICE ( I ) * NO_OF_WIDGETS ( I ); 5688-235 IBM PL/I for MVS & VM CAMRPLI: PROC OPTIONS (MAIN); STMT LEV NT S013K 220 2 1 I = 1; 013K 221 2 1 ORDER_SUB_TOTAL = ORDER_SUB_TOTAL + IT 222 2 1 END; U---> 223 2 0 TOTAL_ORDER_EX: RETURN; ---> 224 2 0 END TOTAL_ORDER;
CAMRPLI finally exited out of the DO loop and continued until it reached the unconditional breakpoint set at TOTAL_ORDER_EX (one of the unconditional breakpoints included in the data set member PLIINCL).
You can see from the keep window that the value of I is 5. This is the proper value to permit the exit of the DO loop. Thus, the use of the skip command allowed us to dynamically fix the program code that caused the loop, and continue execution.
Before going back to the options menu, remove the keep window and skip command as follows.
|
Action: |
Key in the command: remove all Tab down to the I = 1 statement and type over the S to the left of the statement with an x. Press Enter. |
|
Result: |
The keep window is removed, and the skip line command is removed. |
|
Action: |
Continue execution by typing GO and pressing Enter. |
|
Result: |
CAMRPLI resumes execution and displays the Demo Session Options Menu. |
This concludes Option 4: Interrupt a Program Loop. Select another option and go to the appropriate section in this guide, or exit the demo using PF3.
This option illustrates the use of the PREVIOUS and ADVANCE commands to help you trace program execution.
Note: Before proceeding, be sure you have completed the steps outlined in Advanced Demo Preliminaries in this appendix and you have the Demo Session Options Menu displayed on your screen.
|
Action: |
Key in Option 5. Press Enter. |
|
Result: |
CAMRPLI displays the screen that describes what occurs in this part of the demo session. |
The following sample screen shows Option 5: Trace Program Execution:
********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Tracing program execution ***** ***** ***** ********************************************************************** CA InterTest™ Batch gives you the ability to trace the execution of your program up to the point where a breakpoint occurs. Here is what will happen: 1. CA InterTest™ Batch halts the DEMO program at an unconditional breakpoint. 2. You use a combination of the Prev and Advance commands to scroll through the program statements in execution order. 3. You issue the CS command to re-display the Current Statement to be executed. Press ENTER to continue or PF3 to return to the Options Menu.
|
Action: |
Press Enter. |
|
Result: |
The application halts CAMRPLI at an unconditional breakpoint that you included at the abeginning of the demo. |
The following sample screen shows CAMRPLI at an unconditional breakpoint:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000168 000118 000117 000116 000115 000114 000113 000112 000111 000110 0 U0001 168 1 0 PAY_CALC: PROC ( I ); 169 2 0 DCL I PIC '999'; 170 2 0 DCL J FIXED BIN(15); 0001 171 2 0 DO J = 1 TO I BY 1; 0005 172 2 1 CALL POPULATE_GRAPH ( J ); 0005 173 2 1 END; /* CHEQUE_LINE = ' '; */ 0001 174 2 0 CHEQUE_AMOUNT = TOTALGROSS; 0001 175 2 0 RETURN; ---> 176 2 0 END PAY_CALC; 0005 177 1 0 POPULATE_GRAPH: PROC ( I ); 178 2 0 DCL I FIXED BIN(15); 179 2 0 DCL 1 MONTH_THING STATIC,
Suppose you want to trace the execution path of the program prior to this point. You can have the application scroll back and display a previously executed statement using the PREV command. The PREV command lets you view previously executed statements, but does not cause any statements to execute. After you scroll back using the PREV command, you can scroll forward and retrace execution using the ADVANCE command. You may specify a number from 1 to 999 with the PREV and ADVANCE commands to scroll more than one statement at a time.
The PREV and ADVANCE commands do not change the statement where CAMRPLI resumes execution; the PREV and ADVANCE only scroll the statements in the trace.
|
Action: |
Key in the following in the Command field: prev 9 Press Enter. |
|
Result: |
The application displays the ninth previous statement executed. |
The following screen shows the ninth previous statement:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000168 000118 000117 000116 000115 000114 000113 000112 000111 000110 0 0001 110 1 0 DEMONSTRATE_PREV_COMMAND: CALL ISPLINK ( DSPLY, COBDPN75 ); /*------------------------------------------------*/ /* THIS SECTION OF THE DEMO SHOWS YOU */ /* THE BENEFITS OF USING THE PREV */ /* AND ADVANCE COMMANDS. */ /*------------------------------------------------*/ 0001 111 1 0 COBDPN71_LENGTHS = 4; 0001 112 1 0 CALL ISPLINK ( VCOPY, VCOPY_COBDPN71, VCOPY_COBDPN71_LENGTHS, VCOPY_COBDPN71_VALUES, VCOPY_MOVE ); 0001 113 1 0 IF VCOPY_COBDPN71_EIBAID = 'PF03' THEN
Now you can retrace the execution of the nine statements using the ADVANCE command. The short form of the ADVANCE command is A or AD. (You must enter the A on the command line.)
|
Action: |
Key in the command: a Press Enter. |
|
Result: |
The application highlights the next statement executed. |
|
Action: |
Repeat the Advance step a few more times. |
The following screen shows advancing through the program trace:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000168 000118 000117 000116 000115 000114 000113 000112 000111 000110 0 0001 110 1 0 DEMONSTRATE_PREV_COMMAND: CALL ISPLINK ( DSPLY, COBDPN75 ); /*------------------------------------------------*/ /* THIS SECTION OF THE DEMO SHOWS YOU */ /* THE BENEFITS OF USING THE PREV */ /* AND ADVANCE COMMANDS. */ /*------------------------------------------------*/ 0001 111 1 0 COBDPN71_LENGTHS = 4; 0001 112 1 0 CALL ISPLINK ( VCOPY, VCOPY_COBDPN71, VCOPY_COBDPN71_LENGTHS, VCOPY_COBDPN71_VALUES, VCOPY_MOVE ); 0001 113 1 0 IF VCOPY_COBDPN71_EIBAID = 'PF03' THEN
|
Result: |
You can follow the execution order of the program by following the highlighted lines as you advance through the program trace. In effect, using PREV and ADVANCE gives you a simulated instant replay of program execution. |
Now you can return to the current statement, that is, the statement where execution was halted prior to the unconditional breakpoint.
|
Action: |
Enter the command: cs Press Enter. |
|
Result: |
The application displays the original Breakpoint Intercept panel shown in the beginning of this option. |
|
Action: |
Key in the command: go Press Enter |
|
Result: |
CAMRPLI resumes execution and displays the Advanced Options Demo screen. You can continue with any option or exit. |
This concludes Option 5: Trace Program Execution. Select another option and continue with the appropriate section in this guide, or press PF3 to end the demo.
This section of the demo session shows you a fast and easy way to inspect and modify the contents of indexed data items. It also demonstrates how to use the STEP command to single-step execution.
Note: Before proceeding, be sure you have completed the steps outlined in Advanced Demo Preliminaries in this appendix and you have the Demo Session Options Menu displayed on your screen.
|
Action: |
Select Option 6. Press Enter. |
|
Result: |
CAMRPLI displays a screen that describes what occurs in this part of the demo session. |
The following screen shows Option 6: Working with Indexed Table Items:
********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Working with indexed table items ***** ***** ***** ********************************************************************** CA InterTest™ Batch makes it easy to display values of indexed and subscripted data areas. A table defined in WORKING STORAGE has not been initialized. Here is what will happen: 1. CA InterTest™ Batch halts the DEMO program at an automatic breakpoint when it detects an uninitialized table element. 2. You display the table item and correct the contents using the Keep and SET commands. 3. The DEMO program successfully completes execution. Press ENTER to continue or PF3 to return to the Options Menu.
|
Action: |
Press Enter. |
|
Result: |
CAMRPLI resumes execution. |
The next screen you see is an Abend Intercept panel. The application has automatically halted CAMRPLI because it detected a data exception in the highlighted statement.
The following screen shows CAMRPLI at an S0C7 Abend Intercept:
CAMRPLI ---------- CA InterTest™ Batch ABEND S0C7 Intercept ------------------ COMMAND ===> SCROLL ===> CUR TRACE=> 000128 000127 000126 000125 000206 000205 000204 000203 000202 000201 0 0001 128 1 0 DISTRICT ( A1, B1, C1 ) = DISTRICT ( A1, B1, C1 ) + 1; ----------------------------------------------------------------- | THE FOLLOWING AUTOMATIC BREAKPOINT OCCURRED: | ---> | INTERCEPT IN PROGRAM CAMRPLI AT #000128 REASON: ABEND S0C7 | | PRESS ENTER TO REMOVE THIS MESSAGE. | ----------------------------------------------------------------- /* THIS SECTION OF THE DEMO SHOWS YOU HOW TO */ /* INSPECT AND CHANGE THE VALUE OF SUBSCRIPTED */ /* TABLE ITEMS. */ /*------------------------------------------------*/ 0001 130 1 0 DEMONSTRATE_LOOP_DETECTION: /*------------------------------------------------*/ /* THIS SECTION OF THE DEMO SHOWS YOU HOW TO */ /* INTERRUPT A LOOPING PROGRAM AND CHANGE THE */ /* EXECUTION LOGIC _ WITHOUT RE_COMPILATION. */ /*------------------------------------------------*/
If you recall, this is the same type of error detected and corrected in the basic demo session. To continue execution, you need to find the data item causing the S0C7 ABEND and dynamically modify it.
Looking at the highlighted breakpoint statement, you might suspect the variable is at fault; it probably was not initialized correctly. The variable in this case is an indexed table entry.
|
Action: |
Press Enter to remove the ABEND message box. |
|
Result: |
The ABEND message box is removed. |
You can quickly inspect the value of the DISTRICT ( A1, B1, C1 ) field directly from this screen by entering a k to the left of the highlighted statement.
|
Action: |
Tab to the highlighted statement and type k (for keep). Press Enter. |
|
Result: |
The application displays the current value of DISTRICT. It also displays the value of each subscript item, because the k line command requests a display of each item on that line. |
The following panel displays a Keep Window for the Table Entry:
CAMRPLI ---------- CA InterTest™ Batch ABEND S0C7 Intercept ------------------ COMMAND ===> SCROLL ===> CUR TRACE=> 000128 000127 000126 000125 000206 000205 000204 000203 000202 000201 0 ------------------------------------------------------------------------- 1F1A8531 NP-S 000037 04 DISTRICT ?000. A1 (+1) B1 (+3) C1 (+5) ------------------------------------------------------------------------- 0001 128 1 0 DISTRICT ( A1, B1, C1 ) = DISTRICT ( A1, B1, C1 ) + 1; /* TASK_STRUCTURE.TASK_TEXT = ' '; */ ---> 129 1 0 GO TO OPTIONS; /*------------------------------------------------*/ /* THIS SECTION OF THE DEMO SHOWS YOU HOW TO */ /* INSPECT AND CHANGE THE VALUE OF SUBSCRIPTED */ /* TABLE ITEMS. */ /*------------------------------------------------*/ 0001 130 1 0 DEMONSTRATE_LOOP_DETECTION:
The question mark that precedes the value of DISTRICT in the keep window tells us this field does not contain a valid value. This is the error that triggered the automatic breakpoint.
The keep window also tells us which table entry is at fault. The values of each subscript item in this window indicate the invalid data occurs at
element (1, 3, 5).
To dynamically correct this error you need to modify main storage so the field contains valid data. You can use the SET command to set the value to zero. The application sets the variable using the proper format.
|
Action: |
Type the command: set district (a1,b1,c1) = zero Press Enter. |
The following panel corrects the uninitialized Table Item:
CAMRPLI ---------- CA InterTest™ Batch ABEND S0C7 Intercept ------------------ COMMAND ===> set district (a1,b1,c1) = zero SCROLL ===> CUR TRACE=> 000128 000127 000126 000125 000206 000205 000204 000203 000202 000201 0 ------------------------------------------------------------------------- 1F1A8531 NP-S 000037 04 DISTRICT ?000. A1 (+1) B1 (+3) C1 (+5) ------------------------------------------------------------------------- 0001 128 1 0 DISTRICT ( A1, B1, C1 ) = DISTRICT ( A1, B1, C1 ) + 1; /* TASK_STRUCTURE.TASK_TEXT = ' '; */ ---> 129 1 0 GO TO OPTIONS; /*------------------------------------------------*/ /* THIS SECTION OF THE DEMO SHOWS YOU HOW TO */ /* INSPECT AND CHANGE THE VALUE OF SUBSCRIPTED */ /* TABLE ITEMS. */ /*------------------------------------------------*/ 0001 130 1 0 DEMONSTRATE_LOOP_DETECTION:
|
Result: |
Thea application dynamically modifies the value in main storage for DISTRICT ( A1, B1, C1 ), and displays the new value in the keep window. The message on the top right of the panel reads: SET COMPLETE. |
Use the step command to execute just one line of code. The step command lets you determine how many lines are executed when you use the go command. For example, to execute 1 line at a time, or single-step, use the command: step 1.
|
Action: |
Type the command: step 1 Press Enter. |
|
Result: |
The application sets the step count to 1 and displays the following message: STEP COUNT SET. |
The following panel shows setting the step count:
CAMRPLI ---------- CA InterTest™ Batch ABEND S0C7 Intercept ---- STEP COUNT SET COMMAND ===> SCROLL ===> CUR TRACE=> 000128 000127 000126 000125 000206 000205 000204 000203 000202 000201 0 ------------------------------------------------------------------------- 1F1A8531 NP-S 000037 04 DISTRICT +000. A1 (+1) B1 (+3) C1 (+5) ------------------------------------------------------------------------- 0001 128 1 0 DISTRICT ( A1, B1, C1 ) = DISTRICT ( A1, B1, C1 ) + 1; /* TASK_STRUCTURE.TASK_TEXT = ' '; */ ---> 129 1 0 GO TO OPTIONS; /*------------------------------------------------*/ /* THIS SECTION OF THE DEMO SHOWS YOU HOW TO */ /* INSPECT AND CHANGE THE VALUE OF SUBSCRIPTED */ /* TABLE ITEMS. */ /*------------------------------------------------*/ 0001 130 1 0 DEMONSTRATE_LOOP_DETECTION:
|
Action: |
Execute CAMRPLI by entering the command: GO and pressing Enter. |
|
Result: |
The statement that increments the DISTRICT table item is executed, and then the application halts execution and displays a Step Count Intercept panel. Statement 129 is now the current line, and is highlighted. |
When you want to end single-stepping, reset the step count to zero. This turns single stepping off. Remove the step count and keep window before continuing execution.
|
Action: |
Type in the command: step 0; remove all Press Enter. |
|
Result: |
The application resets the step count and removes the keep window. |
To display the current status of the step count, enter the step command without any count number as follows:
|
Action: |
Type in the command: step Press Enter. |
|
Result: |
The application displays the value of the step count in the top-right corner; in this case, the message is: NO STEP COUNT SET. |
|
Action: |
Resume execution of CAMRPLI by entering go. |
|
Result: |
CAMRPLI resumes execution, and you return to the Options Menu. |
This concludes Option 6: Work with Indexed Table Items. Select another option and continue with the appropriate section in this guide, or press PF3 to end the demo.
This option illustrates how to create and view the histogram report of statement execution, which is useful in identifying dead code.
Note: Before proceeding, be sure you have completed the steps outlined in Advanced Demo Preliminaries in this appendix and you have the Demo Session Options Menu displayed on your screen.
|
Action: |
Key in Option 7. Press Enter. |
|
Result: |
CAMRPLI displays the screen that describes what occurs in this part of the demo session. |
The following screen shows Option 7: Histogram Report:
********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Histogram Command ***** ***** ***** ********************************************************************** The HIstogram command writes the execution histogram to DD name INT1REPT. The histogram consists of one line per executable statement. The line contains the statement number, the execution frequency counter and a graphic representation of the number of times the statement has been executed. This command is especially useful when issued at program exit in identifying " dead " code. What will happen is: 1. CA InterTest™ Batch halts the DEMO program at an unconditional breakpoint 2. You enter the HIst command in the command line. 3. CA InterTest™ Batch will write the histogram to the dataset associated with the DD name INT1REPT which can be viewed by splitting the screen. Press ENTER to continue or PF3 to return to the Options Menu.
|
Action: |
Press Enter. |
|
Result: |
The application halts CAMRPLI at an unconditional breakpoint set at the program exit. |
The following screen shows the breakpoint intercept at label RETURN_TO_OPSYS:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000058 000142 000235 000234 000233 000239 000237 000232 000231 000239 0 U---> 58 1 0 RETURN_TO_OPSYS: RELEASE ISPLINK; ---> 59 1 0 CLOSE FILE ( REPORT ); ---> 60 1 0 RETCODE = DM_RC; ---> 61 1 0 CALL PLIRETC ( RETCODE ); ---> 62 1 0 RETURN; 0001 63 1 0 OPTIONS_MENU: /*------------------------------------------------*/ /* INITIALIZE THE LENGTHS IN CASE OF RECURSION. */ /*------------------------------------------------*/ 5688-235 IBM PL/I for MVS & VM CAMRPLI: PROC OPTIONS (MAIN); STMT LEV NT CALL ISPLINK ( DSPLY, PLIDPN70 ); 0001 64 1 0 OPTION_I = 1;
Prior to exiting the program, you can request a histogram report using the HIST command.
|
Action: |
Key in the command: hist Press Enter. |
|
Result: |
The application returns the following message: 'HISTOGRAM SUCCESSFULLY WRITTEN' |
The report is written to the data set associated with the ddname INT1REPT that can be viewed by splitting the screen.
|
Action: |
Tab a few lines down your screen and press the SPLIT PF key defined in your ISPF profile (normally PF2). |
|
Result: |
The ISPF Main Menu displays in the split-screen area. |
|
Action: |
Select the ISPF Browse Facility and request a display of the data set associated with the ddname INT1REPT. You allocated this data set in the Advanced Demo Preliminaries section. The suggested data set name was: userid.INT1REPT Note: In the following example, the report is viewed in SDSF. |
|
Result: |
The first page of the histogram report displays. A sample report is shown in the following panel. |
The following screen shows Browsing the Histogram DD in SDSF:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CSR TRACE=> 000058 000142 000235 000234 000233 000239 000237 000232 000231 000239 U---> 58 1 0 RETURN_TO_OPSYS: . . . . . . . . . . . . . . . . . . . . . . . . . . SYSVIEW 11.5 CA11 ----------------- Output ----------------- 05/02/06 18:01:17 Command ====> Scroll *===> CSR -------------------------------------------------- Lvl 4 Row 1-35 Col 1-80/115 USER001 TSU 27743 DDname - INT1REPT Stepname - CATSO Procstep - CATSO ------------------------------------------------------------------------------ ...+....10...+....20...+....30...+....40...+....50...+....60...+....70...+.... CA InterTest/Batch Execution Histogram For Program-ID: CAMRPLI Date: 000001 0001 |* 000042 0001 |* 000043 0001 |* 000044 0001 |* 000045 0001 |* 000046 0001 |* 000047 0001 |* 000048 0001 |* 000049 0001 |* 000050 ---- | 000051 ---- |
Page down to the end of the report using the maximum command with PF8
|
Action: |
Type in the command: m Press PF8. |
|
Result: |
The last page of the histogram report displays, as shown in the following panel. |
The following screen shows the last page of the histogram report:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CSR TRACE=> 000058 000142 000235 000234 000233 000239 000237 000232 000231 000239 U---> 58 1 0 RETURN_TO_OPSYS: . . . . . . . . . . . . . . . . . . . . . . . . . . SYSVIEW 11.5 CA11 ----------------- Output ----------------- 05/02/0618:06:44 Command ====> Scroll *===>CSR GSVX006I End of data ---------------------- Lvl 4 Row 165-195/195 Col1-80/115 RYARO02 TSU 27743 DDname - INT1REPT Stepname - CATSO Procstep -CATSO ------------------------------------------------------------------------------ ...+....10...+....20...+....30...+....40...+....50...+....60...+....70...+.... 000234 0017 |* 000235 0001 |* 000236 ---- | 000237 0034 |* 000239 0034 |* 000240 ---- | 000241 ---- | 000242 ---- | ----+----|----+----|----+----|----+----|----+----|----+----|----+- *NOTE* ASTERISKS REPRESENT A SCALE OF 00000130 EXECUTION(S) PERAST CA InterTest/Batch Execution Histogram For Program-ID: CAMRPLI Date: Session Number: 54 For Userid RYARO02 Number of executable statements: 174 Number of statements executed during this test: 147 Percentage of statements executed during this test: 84
In the previous panel, you can see that a number of lines were never executed. Check to see if these lines in the program are dead code and should be removed.
Note: In our example, there is unexecuted code starting at line 240. Note the corresponding line number in your program that is unexecuted.
|
Action: |
Remove your split-screen using the command: x |
|
Result: |
You return to a full-screen display of the Program Exit Intercept shown in the beginning of this option. |
Use the Find Statement (FS) command to display the code that was never executed.
|
Action: |
Type in the command: fs 240 Press Enter. |
|
Result: |
The application displays the requested line of code. |
The following screen displays the unexecuted code:
CAMRPLI ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000058 000142 000235 000234 000233 000239 000237 000232 000231 000239 0 RETURN ( I + 1 ); ---> 240 2 0 ELSE RETURN ( I ); ---> 241 2 0 END INCREMENT; ---> 242 1 0 END CAMRPLI; 5688-235 IBM PL/I for MVS & VM CAMRPLI: PROC OPTIONS (MAIN); ATTRIBUTE AND CROS DCL NO. IDENTIFIER ATTRIBUTES AND REFERENCES 3 ASA_CNTL /* IN LINE_OUT */ AUTOMATIC UN 5 A1 AUTOMATIC ALIGNED BINARY FIXED 125,128,128 18 BALANCE_LINE /* IN BALANCE_OUT */ AUTOMATIC 18 BALANCE_OUT AUTOMATIC /* STRUCTURE */ 17 BALANCE_REPORT AUTOMATIC /* STRUCTURE */ 188 BILL_CALC ENTRY RETURNS(DECIMAL /* SINGL 102 101 BILL_YTD /* IN BILLING_VALUES */ AUTOMA
By reviewing the code, you can determine whether or not it is required. In this case, it is required for the program and should be retained.
If unexecuted code needs to be removed from your own programs, you can split the screen again and make the code changes, or wait until you complete the review of the histogram report.
Now return to the current statement in the CAMRPLI program.
|
Action: |
Type in the command: cs Press Enter. |
|
Result: |
The application displays the Program Exit Intercept panel. |
|
Action: |
To continue the advanced demo, enter the command go options and press Enter. or To end the demo, enter the GO command. |
|
Result: |
If you are continuing the demo, CAMRPLI program execution continues with the display of the Advanced Options Menu. Choose another option from the menu. or If you are exiting the demo, CAMRPLI resumes execution at the normal program exit, and terminates. You return to the Execution Control panel of the Foreground Option. Your previous entries are displayed, allowing you to begin testing again, or exit. Use PF3 to exit. |
|
Copyright © 2013 CA.
All rights reserved.
|
|