Previous Topic: Advanced Demo PreliminariesNext Topic: Advanced Demo Session for Assembler


Advanced Demo Session for COBOL

This section illustrates a COBOL advanced demo session using CAMRCOB2. The screen images for the other COBOL demos may vary from those shown here, but the steps for performing the demo are the same.

Include Unconditional Breakpoints

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 DEMOINCL data set member of CAI.CAISRC contains the application commands that set the breakpoints required for using the Advanced Options Demo for COBOL. Include this data set member as follows:

Action:

Enter the following command at the *Initial* Intercept panel:

include demoincl

Press Enter.

Result:

The application processes the commands in the demoincl data set, and returns the following message in the upper-right corner of the screen: BREAKPOINT SET.

CAMRCOB2 ---------- CA InterTest™ Batch *INITIAL* Intercept ----- BREAKPOINT SET COMMAND ===> SCROLL ===> CUR TRACE=> 000876 000875 PROCEDURE DIVISION USING PARAMETER-AREA. *--> 000876 START-PROGRAM. *--> 000877 OPEN OUTPUT REPORT-OUT. 000878 * -----------------------------------------------* 000879 * Welcome to the CA InterTest™ Batch COBOL II * 000880 * Demonstration Program. You are now at the * 000881 * Initial Breakpoint panel which is displayed * 000882 * upon entry to the first program to be tested. * 000883 * At this point, other breakpoints can be set * 000884 * and control commands can be issued before the * 000885 * program is executed. * 000886 * -----------------------------------------------* *--> 000887 MOVE R1498-TIMEI TO R1498-TIME. *--> 000888 PERFORM TIME-EDIT THRU TIME-EDIT-EX. 000889 * *--> 000890 MOVE R1498-TIMEO TO R1498-TIME. *--> 000891 PERFORM TIME-EDIT THRU TIME-EDIT-EX. *--> 000892 GO TO DISPLAY-1ST-PANEL. 000893 * -----------------------------------------------* 000894 * THIS ROUTINE EDITS INPUT TIME FOR VALIDITY *

Access the Demo Session Options Menu

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 CAMRCOB2 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 COBOL 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 DEMOINCL.

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 DEMOINCL", 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. Upon completing an Option, you return to the Menu.

Before you start you should know that to interrupt a loop you must 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.

Exit the Advanced Options Demo

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 Exit Intercept panel displays.

 

Action:

Type GO and press Enter to execute the program.

Result:

The demo program ends, and the Entry panel displays.

Return to the Advanced Options Demo Session

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 demoincl

Option 1: Time-Controlled Execution

This option illustrates how you can slow the execution of your program. The SLOW command executes one verb 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 allows you to 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:

CAMRCOB2 displays the panel 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 CAMRCOB2 at an unconditional breakpoint set at the paragraph PAY-CALC. The first executable statement in that paragraph is the current statement, and is highlighted.

Open a keep window that displays the values of YTD and X-AXIS by entering commands shown following. 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

Result:

CA InterTest™ Batch displays a keep window showing the current values of YTD and X-AXIS.

A sample screen showing the keep window for YTD and X-AXIS follows:

CAMRCOB2 ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001055 001053 001052 001051 001049 001043 001042 001040 001035 001017 0 ------------------------------------------------------------------------- 1F08CB11 ND-OT 000683 03 YTD +0000000.00 1F08C8E0 AN 000553 05 X-AXIS ------------------------------------------------------------------------- 001054 * U---> 001055 PAY-CALC. ---> 001056 PERFORM POPULATE-GRAPH THRU POPULATE-GRAPH-EX 001057 VARYING SUB-4 FROM 1 BY 1 001058 UNTIL SUB-4 GREATER THAN NO-OF-HOURS. ---> 001059 PAY-CALC-EX. ---> 001060 MOVE SPACES TO CHEQUE-LINE. ---> 001061 MOVE TOTAL-GROSS TO CHEQUE-AMOUNT. ---> 001062 PAY-RETURN. ---> 001063 GO TO OPTIONS. 001064 * ---> 001065 POPULATE-GRAPH. ---> 001066 MOVE MONTH-ITEM(SUB-4) TO X-AXIS-YTD. ---> 001067 MOVE TOKEN-ITEM TO X-AXIS-R(SUB-4). ---> 001068 ADD MONTHLY-AMOUNT(SUB-4) TO YTD. ---> 001069 MOVE YTD TO TOTAL-GROSS.

Issue the SLOW command to execute one verb every two seconds. As the program resumes execution, you are able to see the changing values of YTD and X-AXIS. In this demo, you are going to halt execution when the X-AXIS 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 CAMRCOB2, at a rate of one verb every two seconds.

 

Action:

When the value of X-AXIS 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:

CAMRCOB2 ---------- CA InterTest™ Batch ATTENTION Intercept ------------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001069 001068 001067 001066 001065 001071 001070 001069 001068 001067 0 ------------------------------------------------------------------------- 1F08CB11 ND-OT 000683 03 YTD +0255273.52 1F08C8E0 AN 000553 05 X-AXIS Mar ->->-> ------------------------------------------------------------------------- 001054 * U0001 001055 PAY-CALC. 0001 001056 PERFORM POPULATE-GRAPH THRU POPULATE-GRAPH-EX 001057 VARYING SUB-4 FROM 1 BY 1 001058 UNTIL SUB-4 GREATER THAN NO-OF-HOURS. ---> 001059 PAY-CALC-EX. ---> 001060 MOVE SPACES TO CHEQUE-LINE. ---> 001061 MOVE TOTAL-GROSS TO CHEQUE-AMOUNT. ---> 001062 PAY-RETURN. ---> 001063 GO TO OPTIONS. 001064 * 0003 001065 POPULATE-GRAPH. 0003 001066 MOVE MONTH-ITEM(SUB-4) TO X-AXIS-YTD. 0003 001067 MOVE TOKEN-ITEM TO X-AXIS-R(SUB-4). 0003 001068 ADD MONTHLY-AMOUNT(SUB-4) TO YTD. 0002 001069 MOVE YTD TO TOTAL-GROSS. 0002 001070 POPULATE-GRAPH-EX.

Review what you just did.

This combination of using keep windows, the slow command, and an Attention Intercept allows you to carefully control and monitor your program execution, while tracking the values of specific variables.

Note: The Attention Intercept panel is only displayed when you press the ATTN or PA1 key and then the application executes a statement in a program that is currently being monitored.

Remove the Keep Window

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 on the Attention Intercept panel.

Continue Execution

Action:

Type GO and press Enter to continue execution.

Result:

CAMRCOB2 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.

Option 2: Set Conditional Breakpoints

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:

CAMRCOB2 displays the screen that describes what occurs in this part of the demo session, as shown in the following panel:

********************************************************************** ***** ***** ***** 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 CAMRCOB2 at an unconditional breakpoint. The first executable statement in the paragraph 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 application displays the When panel. 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 ===> sub-total 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 sub-total; set total-gross=2000; k total-gross

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:

CAMRCOB2 resumes execution until the condition you set for the YTDCOND breakpoint is met; when the value of SUB-TOTAL is greater than or equal to 600, the application halts execution, and executes the commands you entered for the conditional breakpoint; it displays a keep window for SUB-TOTAL, sets TOTAL-GROSS to 2000, and then displays TOTAL-GROSS in the keep window. Your screen should look like the Intercept panel in the following panel.

A sample Intercept panel showing condition YTDCOND has been met follows:

CAMRCOB2 ---------- CA InterTest™ Batch WHEN YTDCOND BEFORE Intercept --------- COMMAND ===> SCROLL ===> CUR TRACE=> 001102 001101 001100 001104 001103 001102 001101 001100 001104 001103 ------------------------------------------------------------------------ 1F08CAFC ND-OT 000679 03 SUB-TOTAL +0000971.68 1F08CB08 ND-OT 000682 03 TOTAL-GROSS +0002000.00 ------------------------------------------------------------------------ 0003 001101 ADD BILLING-AMOUNT(SUB-7) TO SUB-TOTAL. 0002 001102 MOVE SUB-TOTAL TO BILL-YTD. 0002 001103 BILL-CALC-EX. 0002 001104 EXIT. 001105 001106 ---> 001107 DEMONSTRATE-SPLIT-SCREEN. 001108 * -----------------------------------------------* 001109 * This section of the Demo shows you how to * 001110 * SPLIT the screen .. .. * 001111 * -----------------------------------------------* ---> 001112 CALL 'ISPLINK' USING DSPLY, 001113 COBDPN73. ---> 001114 MOVE 4 TO COBDPN71-LENGTHS. ---> 001115 CALL 'ISPLINK' USING VCOPY, 001116 VCOPY-COBDPN71,

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:

OPTION: ===> r

WHEN NAME ===> ytdcond

Press Enter

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 and Continue Execution

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:

CAMRCOB2 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.

Option 3: Update Source Code

This option illustrates how you can use the ISPF or CA Roscoe 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:

CAMRCOB2 displays the screen that describes what occurs in this part of the demo session.

A sample Option 3: Updating Source Code (ISPF Users) 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.

A sample Option 3: Updating Source Code (CA ROSCOE users) follows:

********************************************************************** ***** ***** ***** CA InterTest™ Batch Demo Session ***** ***** Updating Source Code ***** ***** SPLITting and SQAPping ***** ********************************************************************** At any time during your debugging session you can SPLIT your screen and engage in another CA ROSCOE 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 by typing :S in the first unprotected field and press PF12, or any other PF key defined at your installation. 3. You can SQAP to the other session by typing :W and press PF12, or any other PF key defined at your installation. Press ENTER to continue or PF3 to return to the Options Menu.

Action:

Press Enter.

Result:

The application halts CAMRCOB2 at an unconditional breakpoint at the paragraph SPLIT-SCREEN.

Action:

ISPF users:

Tab about halfway down your screen and press the SPLIT PF key defined in your ISPF profile (normally PF2).

CA Roscoe users:

Enter the CA Roscoe SPLIT sequence.

Result:

ISPF users:

The ISPF Primary Option Menu displays in the bottom half of your screen.

CA Roscoe users:

A second CA Roscoe panel displays.

A sample showing using a split-screen from an Intercept Panel (ISPF Users) follows:

CAMRCOB2 ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001123 001121 001115 001114 001112 001107 001021 001020 001018 001016 ---> 001122 GO TO OPTIONS. U---> 001123 SPLIT-SCREEN. ---> 001124 MOVE R1498-TIMEO TO R1498-TIME. ---> 001125 GO TO OPTIONS. 001126 * -----------------------------------------------* 001127 * From this Unconditional Breakpoint you can * 001128 * press the PF key assigned to the SPLIT command * 001129 * which takes you to the ISPF Main Menu. * 001130 * -----------------------------------------------* 001131 001132 . . . . . . . . . . . . . . . . . . . . . . . . . . . ----------------------- ISPF/PDF PRIMARY OPTION MENU ISPF HELP - 461-1005 ----------------------- VERSION 3 RELEASE 1 -------------------- OPTION ===> USERID - PHUMPHR 0 ISPF PARMS - Specify terminal and user parameters TIME - 14:37 1 BROWSE - Display source data or output listings TERMINAL - 3278 2 EDIT - Create or change source data PF KEYS - 24 3 UTILITIES - Perform utility functions DATE(G) - 90/12/18 4 FOREGROUND - Invoke lang. processors in foreground DATE(J) - 90.352 5 BATCH - Submit job for language processing 6 COMMAND - Enter TSO command or CLIST 7 DIALOG TEST - Perform dialog testing

Update Your Source Code

If you had found an error in your program code, you can use the ISPF menu or CA Roscoe 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.

Continue Execution

Action:

ISPF users:

Remove your ISPF split-screen using the command: =x

CA Roscoe users:

Use the CA Roscoe END key to end the second session.

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.

Option 4: Interrupt a Looping Program

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:

CAMRCOB2 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 CAMRCOB2 at an unconditional breakpoint set at ORDER-CALC.

A sample screen showing the CAMRCOB2 stopped at ORDER-CALC follows:

CAMRCOB2 ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001232 001225 001219 001218 001216 001210 001023 001022 001020 001018 001231 * -----------------------------------------------* U---> 001232 ORDER-CALC. ---> 001233 MOVE CUSTOMER-VALUES TO CUSTOMER-ORDER. ---> 001234 MOVE ZEROES TO ORDER-SUB-TOTAL, SUB-6, LOOP-OUT. ---> 001235 PERFORM TOTAL-ORDER THRU TOTAL-ORDER-EX 001236 UNTIL SUB-6 EQUAL 5. U---> 001237 ORDER-CALC-EX. ---> 001238 GO TO OPTIONS. ---> 001239 TOTAL-ORDER. ---> 001240 ADD 1 TO SUB-6. ---> 001241 ADD 1 TO LOOP-OUT. ---> 001242 MULTIPLY UNIT-PRICE(SUB-6) BY NO-OF-WIDGETS(SUB-6) 001243 GIVING ITEM-TOTAL. ---> 001244 ADD ITEM-TOTAL TO ORDER-SUB-TOTAL. ---> 001245 MOVE 1 TO SUB-6. ---> 001246 TOTAL-ORDER-EX. 001247 *------------------------------------------------* 001248 * The code above will loop. The loop can be *

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:

CAMRCOB2 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 5000 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.

Continue from the “Safety Net” Conditional Breakpoint

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:

CAMRCOB2 ---------- CA InterTest™ Batch WHEN LOOPCOND BEFORE Inter- SET COMPLETE COMMAND ===> SCROLL ===> CUR TRACE=> 001242 001241 001240 001239 001253 001246 001245 001244 001242 001241 001231 * -----------------------------------------------* U0001 001232 ORDER-CALC. 0001 001233 MOVE CUSTOMER-VALUES TO CUSTOMER-ORDER. 0001 001234 MOVE ZEROES TO ORDER-SUB-TOTAL, SUB-6, LOOP-OUT. 0001 001235 PERFORM TOTAL-ORDER THRU TOTAL-ORDER-EX 001236 UNTIL SUB-6 EQUAL 5. U---> 001237 ORDER-CALC-EX. ---> 001238 GO TO OPTIONS. 5001 001239 TOTAL-ORDER. 5001 001240 ADD 1 TO SUB-6. 5001 001241 ADD 1 TO LOOP-OUT. 5000 001242 MULTIPLY UNIT-PRICE(SUB-6) BY NO-OF-WIDGETS(SUB-6) 001243 GIVING ITEM-TOTAL. 5000 001244 ADD ITEM-TOTAL TO ORDER-SUB-TOTAL. 5000 001245 MOVE 1 TO SUB-6. 5000 001246 TOTAL-ORDER-EX. 001247 *------------------------------------------------*

To continue with the looping program demo, you must press the ATTN or PA1 key before 5000 executions of the loop this time. To continue the program loop, use the following steps:

  1. Type a g to the left of the line:

    MOVE ZEROES TO ORDER-SUB-TOTAL, SUB-6, LOOP-0

  2. Press Enter to continue the loop execution.
  3. Press the ATTN key or the RESET, then PA1 keys. Try the ATTN key first. If that does not work, your testing environment requires you to use the PA1 key.

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:

  1. Enter the command: go options
  2. Press Enter.

    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.

Continue from the Attention Routine

The Attention Intercept panel displays. A sample showing an Attention Intercept in TOTAL-ORDER Routine follows:

CAMRCOB2 ----------- CA InterTest™ Batch ATTENTION INTERCEPT ------------------- COMMAND ===> SCROLL ===> PAGE TRACE=> 001244 001243 001242 001241 001255 001248 001247 001246 001244 001243 0 001231 * -----------------------------------------------* U0001 001232 ORDER-CALC. 0001 001233 MOVE CUSTOMER-VALUES TO CUSTOMER-ORDER. 0001 001234 MOVE ZEROES TO ORDER-SUB-TOTAL, SUB-6, LOOP-OUT. 0001 001235 PERFORM TOTAL-ORDER THRU TOTAL-ORDER-EX 001236 UNTIL SUB-6 EQUAL 5. U---> 001237 ORDER-CALC-EX. ---> 001238 GO TO OPTIONS. 1926 001239 TOTAL-ORDER. 1926 001240 ADD 1 TO SUB-6. 1926 001241 ADD 1 TO LOOP-OUT. 1925 001242 MULTIPLY UNIT-PRICE(SUB-6) BY NO-OF-WIDGETS(SUB-6) 001243 GIVING ITEM-TOTAL. 1925 001244 ADD ITEM-TOTAL TO ORDER-SUB-TOTAL. 1925 001245 MOVE 1 TO SUB-6. 1925 001246 TOTAL-ORDER-EX. 001247 *------------------------------------------------*

CAMRCOB2 never left the TOTAL-ORDER routine, 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 SUB-6 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 sub-6

Press Enter.

Result:

The application displays a keep window for the variable SUB-6.

A sample screen showing the keep window to view SUB-6 follows:

CAMRCOB2 ----------- CA InterTest™ Batch ATTENTION INTERCEPT ------------------ COMMAND ===> SCROLL ===> PAGE TRACE=> 001244 001243 001242 001241 001255 001248 001247 001246 001244 001243 0 ------------------------------------------------------------------------- 001424D8 NB-S 000046 77 SUB-6 +0002. ------------------------------------------------------------------------- 001231 * -----------------------------------------------* U0001 001232 ORDER-CALC. 0001 001233 MOVE CUSTOMER-VALUES TO CUSTOMER-ORDER. 0001 001234 MOVE ZEROES TO ORDER-SUB-TOTAL, SUB-6, LOOP-OUT. 0001 001235 PERFORM TOTAL-ORDER THRU TOTAL-ORDER-EX 001236 UNTIL SUB-6 EQUAL 5. U---> 001237 ORDER-CALC-EX. ---> 001238 GO TO OPTIONS. 1926 001239 TOTAL-ORDER. 1926 001240 ADD 1 TO SUB-6. 1926 001241 ADD 1 TO LOOP-OUT. 1925 001242 MULTIPLY UNIT-PRICE(SUB-6) BY NO-OF-WIDGETS(SUB-6) 001243 GIVING ITEM-TOTAL. 1925 001244 ADD ITEM-TOTAL TO ORDER-SUB-TOTAL. 1925 001245 MOVE 1 TO SUB-6. 1925 001246 TOTAL-ORDER-EX.

Action:

Key in the following command to execute CAMRCOB2 one verb every two seconds: slow 2

Press Enter.

Result:

CAMRCOB2 continues a slow execution. As the code executes, you can see the code looping, and you can see the corresponding value of SUB-6 in the keep window.

The following sample screen of a SLOW 2 Execution shows a Loop and SUB-6 problem:

CAMRCOB2 ---------- CA InterTest™ Batch STEP BEFORE Intercept ----------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001244 001242 001241 001240 001239 001253 001246 001245 001244 001242 ------------------------------------------------------------------------ 1F08D1C8 NB-S 000044 77 SUB-6 +0002. ------------------------------------------------------------------------ 001231 * -----------------------------------------------* U0001 001232 ORDER-CALC. 0001 001233 MOVE CUSTOMER-VALUES TO CUSTOMER-ORDER. 0001 001234 MOVE ZEROES TO ORDER-SUB-TOTAL, SUB-6, LOOP-OUT. 0001 001235 PERFORM TOTAL-ORDER THRU TOTAL-ORDER-EX 001236 UNTIL SUB-6 EQUAL 5. U---> 001237 ORDER-CALC-EX. ---> 001238 GO TO OPTIONS. 5002 001239 TOTAL-ORDER. 5002 001240 ADD 1 TO SUB-6. 5002 001241 ADD 1 TO LOOP-OUT. 5002 001242 MULTIPLY UNIT-PRICE(SUB-6) BY NO-OF-WIDGETS(SUB-6) 001243 GIVING ITEM-TOTAL. 5001 001244 ADD ITEM-TOTAL TO ORDER-SUB-TOTAL. 5001 001245 MOVE 1 TO SUB-6. 5001 001246 TOTAL-ORDER-EX. 001247 *------------------------------------------------* 001248 * The code above will loop. The loop can be *

Notice that SUB-6 changes from 1 to 2, but back to 1 again. SUB-6 is being reset to 1, and causing the program to loop. The value of SUB-6 is preventing the exit of the TOTAL-ORDER routine.

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: MOVE 1 TO SUB-6, and key an s to the left of the line.

The following sample screen shows using Skip to bypass the cause of the loop:

CAMRCOB2 ---------- CA InterTest™ Batch ATTENTION Intercept ------------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001244 001242 001241 001240 001239 001253 001246 001245 001244 001242 ------------------------------------------------------------------------ 1F08D1C8 NB-S 000044 77 SUB-6 +0002. ------------------------------------------------------------------------ 001231 * -----------------------------------------------* U0001 001232 ORDER-CALC. 0001 001233 MOVE CUSTOMER-VALUES TO CUSTOMER-ORDER. 0001 001234 MOVE ZEROES TO ORDER-SUB-TOTAL, SUB-6, LOOP-OUT. 0001 001235 PERFORM TOTAL-ORDER THRU TOTAL-ORDER-EX 001236 UNTIL SUB-6 EQUAL 5. U---> 001237 ORDER-CALC-EX. ---> 001238 GO TO OPTIONS. 5002 001239 TOTAL-ORDER. 5002 001240 ADD 1 TO SUB-6. 5002 001241 ADD 1 TO LOOP-OUT. 5002 001242 MULTIPLY UNIT-PRICE(SUB-6) BY NO-OF-WIDGETS(SUB-6) 001243 GIVING ITEM-TOTAL. 5001 001244 ADD ITEM-TOTAL TO ORDER-SUB-TOTAL. s5001 001245 MOVE 1 TO SUB-6. 5001 001246 TOTAL-ORDER-EX. 001247 *------------------------------------------------* 001248 * The code above will loop. The loop can be *

Result:

The application skips the execution of the MOVE statement, and executes the code as if the MOVE statement was removed.

Action:

Tab up to the first statement in the TOTAL-ORDER routine, ADD 1 to SUB-6, 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:

CAMRCOB2 ---------- CA InterTest™ Batch ATTENTION Intercept ------------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001244 001242 001241 001240 001239 001253 001246 001245 001244 001242 ------------------------------------------------------------------------ 1F08D1C8 NB-S 000044 77 SUB-6 +0002. ------------------------------------------------------------------------ 001231 * -----------------------------------------------* U0001 001232 ORDER-CALC. 0001 001233 MOVE CUSTOMER-VALUES TO CUSTOMER-ORDER. 0001 001234 MOVE ZEROES TO ORDER-SUB-TOTAL, SUB-6, LOOP-OUT. 0001 001235 PERFORM TOTAL-ORDER THRU TOTAL-ORDER-EX 001236 UNTIL SUB-6 EQUAL 5. U---> 001237 ORDER-CALC-EX. ---> 001238 GO TO OPTIONS. 5002 001239 TOTAL-ORDER. g5002 001240 ADD 1 TO SUB-6. 5002 001241 ADD 1 TO LOOP-OUT. 5002 001242 MULTIPLY UNIT-PRICE(SUB-6) BY NO-OF-WIDGETS(SUB-6) 001243 GIVING ITEM-TOTAL. 5001 001244 ADD ITEM-TOTAL TO ORDER-SUB-TOTAL. S5001 001245 MOVE 1 TO SUB-6. 5001 001246 TOTAL-ORDER-EX. 001247 *------------------------------------------------* 001248 * The code above will loop. The loop can be *

 

Press Enter.

Result:

CAMRCOB2 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 screen shows an unconditional breakpoint at ORDER-CALC-EX:

CAMRCOB2 ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001237 001253 001246 001244 001242 001241 001240 001239 001253 001246 ------------------------------------------------------------------------ 1F08D1C8 NB-S 000044 77 SUB-6 +0005. ------------------------------------------------------------------------ 001231 * -----------------------------------------------* U0001 001232 ORDER-CALC. 0001 001233 MOVE CUSTOMER-VALUES TO CUSTOMER-ORDER. 0001 001234 MOVE ZEROES TO ORDER-SUB-TOTAL, SUB-6, LOOP-OUT. 0001 001235 PERFORM TOTAL-ORDER THRU TOTAL-ORDER-EX 001236 UNTIL SUB-6 EQUAL 5. U---> 001237 ORDER-CALC-EX. ---> 001238 GO TO OPTIONS. 5004 001239 TOTAL-ORDER. 5005 001240 ADD 1 TO SUB-6. 5005 001241 ADD 1 TO LOOP-OUT. 5005 001242 MULTIPLY UNIT-PRICE(SUB-6) BY NO-OF-WIDGETS(SUB-6) 001243 GIVING ITEM-TOTAL. 5005 001244 ADD ITEM-TOTAL TO ORDER-SUB-TOTAL. S5001 001245 MOVE 1 TO SUB-6. 5004 001246 TOTAL-ORDER-EX. 001247 *------------------------------------------------* 001248 * The code above will loop. The loop can be *

CAMRCOB2 finally executed out of the TOTAL-ORDER routine, and continued until it reached unconditional breakpoint set at ORDER-CALC-EX (one of the unconditional breakpoints included in the data set member demoincl).

You can see from the keep window that the value of SUB-6 is 5. This is the proper value to permit the exit of the ORDER-CALC routine. Thus, the use of the skip command allowed us to dynamically fix the program code that caused the loop, and continue execution.

Remove the Keep Window and Skip Command

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 and type over the S to the left of the MOVE 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:

CAMRCOB2 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.

Option 5: Trace Program Execution

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:

CAMRCOB2 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 CAMRCOB2 at an unconditional breakpoint that you included at the beginning of the demo.

The following sample screen shows CAMRCOB2 at an unconditional breakpoint:

CAMRCOB2 ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001055 001158 001157 001156 001155 001153 001147 001146 001139 001137 001054 * U---> 001055 PAY-CALC. ---> 001056 PERFORM POPULATE-GRAPH THRU POPULATE-GRAPH-EX 001057 VARYING SUB-4 FROM 1 BY 1 001058 UNTIL SUB-4 GREATER THAN NO-OF-HOURS. ---> 001059 PAY-CALC-EX. ---> 001060 MOVE SPACES TO CHEQUE-LINE. ---> 001061 MOVE TOTAL-GROSS TO CHEQUE-AMOUNT. ---> 001062 PAY-RETURN. ---> 001063 GO TO OPTIONS. 001064 * ---> 001065 POPULATE-GRAPH. ---> 001066 MOVE MONTH-ITEM(SUB-4) TO X-AXIS-YTD. ---> 001067 MOVE TOKEN-ITEM TO X-AXIS-R(SUB-4). ---> 001068 ADD MONTHLY-AMOUNT(SUB-4) TO YTD. ---> 001069 MOVE YTD TO TOTAL-GROSS. ---> 001070 POPULATE-GRAPH-EX. ---> 001071 EXIT. ---> 001072 DEMONSTRATE-CONDITIONAL-BKPT. ---> 001073 CALL 'ISPLINK' USING DSPLY,

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 CAMRCOB2 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 9th previous statement executed.

The following screen shows the ninth previous statement:

CAMRCOB2 ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001055 001158 001157 001156 001155 001153 001147 001146 001139 001137 001136 0001 001137 DEMONSTRATE-PREV-COMMAND. 001138 * 0001 001139 CALL 'ISPLINK' USING DSPLY, 001140 COBDPN75. 001141 * -----------------------------------------------* 001142 * This section of the Demo shows you * 001143 * the benefits of using the Prev * 001144 * and Advance commands.. .. * 001145 * -----------------------------------------------* 0001 001146 MOVE 4 TO COBDPN71-LENGTHS. 0001 001147 CALL 'ISPLINK' USING VCOPY, 001148 VCOPY-COBDPN71, 001149 VCOPY-COBDPN71-LENGTHS, 001150 VCOPY-COBDPN71-VALUES, 001151 VCOPY-MOVE. 001152 * 0001 001153 IF VCOPY-COBDPN71-EIBAID = 'PF03' OR 'PF15' ---> 001154 GO TO OPTIONS. 0001 001155 MOVE SPACES TO X-AXIS.

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:

CAMRCOB2 ---------- CA InterTest™ Batch UNCOND BEFORE Intercept --------------- COMMAND ===> SCROLL ===> CUR TRACE=> 001055 001158 001157 001156 001155 001153 001147 001146 001139 001137 001136 0001 001137 DEMONSTRATE-PREV-COMMAND. 001138 * 0001 001139 CALL 'ISPLINK' USING DSPLY, 001140 COBDPN75. 001141 * -----------------------------------------------* 001142 * This section of the Demo shows you * 001143 * the benefits of using the Prev * 001144 * and Advance commands.. .. * 001145 * -----------------------------------------------* 0001 001146 MOVE 4 TO COBDPN71-LENGTHS. 0001 001147 CALL 'ISPLINK' USING VCOPY, 001148 VCOPY-COBDPN71, 001149 VCOPY-COBDPN71-LENGTHS, 001150 VCOPY-COBDPN71-VALUES, 001151 VCOPY-MOVE. 001152 * 0001 001153 IF VCOPY-COBDPN71-EIBAID = 'PF03' OR 'PF15' ---> 001154 GO TO OPTIONS. 0001 001155 MOVE SPACES TO X-AXIS.

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.

Return to the Current Statement

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:

CAMRCOB2 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.

Option 6: Work with Indexed Table Items

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:

CAMRCOB2 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:

CAMRCOB2 resumes execution.

The next screen you see is an Abend Intercept panel. The application has automatically halted CAMRCOB2 because it detected a data exception in the highlighted ADD instruction.

The following screen shows the CAMRCOB2 at an S0C7 Abend Intercept:

CAMRCOB2 ---------- CA InterTest™ Batch ABEND S0C7 Intercept ------------------ COMMAND ===> SCROLL ===> CUR TRACE=> 001184 001183 001182 001181 001196 001195 001193 001192 001196 001195 0001 001183 SET C1 TO 5. 0001 001184 ADD +1 TO DISTRICT ( A1, B1, C1 ). ---> 001185 MOVE SPACES TO TASK-TEXT OF TASK-STRUCTURE. 001186 * -----------------------------------------------* 001187 * This section of the Demo shows you how to * 001188 * inspect and change the value of subscripted * 001189 * table items.. .. * 001190 * -----------------------------------------------* ---> 001191 GO TO OPTIONS. PP 5655-G53 IBM Enterprise COBOL for z/OS and OS/390 3.1.0 CAMRCOB2 LineID ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+ 0018 001192 INITIALIZE-TABLE. 0018 001193 MOVE SUB-1 TO STATE-NUMBER (SUB-1), 001194 COUNTY-NUM1 (SUB-1, SUB-2). 0018 001195 MOVE ',' TO COUNTY-COMM (SUB-1, SUB-2). 0018 001196 MOVE SUB-2 TO COUNTY-NUM2 (SUB-1, SUB-2). ---> 001197 SET-VAR-REC. ---> 001198 MOVE +100 TO VAR-REC-LEN. ---> 001199 MOVE ZERO TO VAR-SS. ---> 001200 PROCESS-VAR.

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.

Display an Indexed Table Entry

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 ADD instruction and type k (for keep).

Press Enter.

Result:

The application displays the current value of DISTRICT. It also displays the value of each subscripted index item, because the k line command requests a display of each item on that line.

The following panel shows displaying a keep window for the Table Entry:

CAMRCOB2 ---------- CA InterTest™ Batch ABEND S0C7 Intercept ------------------ COMMAND ===> SCROLL ===> CUR TRACE=> 001184 001183 001182 001181 001196 001195 001193 001192 001196 001195 ------------------------------------------------------------------------ 1F08E5BE NP-S 000856 07 DISTRICT ?000. A1 (+1) B1 (+3) C1 (+5) ------------------------------------------------------------------------ 0001 001183 SET C1 TO 5. 0001 001184 ADD +1 TO DISTRICT ( A1, B1, C1 ). ---> 001185 MOVE SPACES TO TASK-TEXT OF TASK-STRUCTURE. 001186 * -----------------------------------------------* 001187 * This section of the Demo shows you how to * 001188 * inspect and change the value of subscripted * 001189 * table items.. .. * 001190 * -----------------------------------------------* ---> 001191 GO TO OPTIONS. PP 5655-G53 IBM Enterprise COBOL for z/OS and OS/390 3.1.0 CAMRCOB2 LineID ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+ 0018 001192 INITIALIZE-TABLE. 0018 001193 MOVE SUB-1 TO STATE-NUMBER (SUB-1),

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 index item in this window indicate the invalid data occurs at element (1, 3, 5).

Dynamically Correct an Uninitialized Table Item

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 shows correcting the uninitialized Table Item:

CAMRCOB2 ---------- CA InterTest™ Batch ABEND S0C7 Intercept ------------------ COMMAND ===> set district (a1,b1,c1) = zero SCROLL ===> CUR TRACE=> 001184 001183 001182 001181 001196 001195 001193 001192 001196 001195 ------------------------------------------------------------------------ 1F08E5BE NP-S 000856 07 DISTRICT ?000. A1 (+1) B1 (+3) C1 (+5) ------------------------------------------------------------------------ 0001 001183 SET C1 TO 5. 0001 001184 ADD +1 TO DISTRICT ( A1, B1, C1 ). ---> 001185 MOVE SPACES TO TASK-TEXT OF TASK-STRUCTURE. 001186 * -----------------------------------------------* 001187 * This section of the Demo shows you how to * 001188 * inspect and change the value of subscripted * 001189 * table items.. .. * 001190 * -----------------------------------------------* ---> 001191 GO TO OPTIONS. PP 5655-G53 IBM Enterprise COBOL for z/OS and OS/390 3.1.0 CAMRCOB2 LineID ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+ 0018 001192 INITIALIZE-TABLE. 0018 001193 MOVE SUB-1 TO STATE-NUMBER (SUB-1),

Result:

The 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.

Single-Step Execution

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 one 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 one and displays the following message: STEP COUNT SET.

The following panel shows setting the step count:

CAMRCOB2 ---------- CA InterTest™ Batch ABEND S0C7 Intercept ---- STEP COUNT SET COMMAND ===> SCROLL ===> CUR TRACE=> 001184 001183 001182 001181 001196 001195 001193 001192 001196 001195 ------------------------------------------------------------------------ 1F08E5BE NP-S 000856 07 DISTRICT +000. A1 (+1) B1 (+3) C1 (+5) ------------------------------------------------------------------------ 0001 001183 SET C1 TO 5. 0001 001184 ADD +1 TO DISTRICT ( A1, B1, C1 ). ---> 001185 MOVE SPACES TO TASK-TEXT OF TASK-STRUCTURE. 001186 * -----------------------------------------------* 001187 * This section of the Demo shows you how to * 001188 * inspect and change the value of subscripted * 001189 * table items.. .. * 001190 * -----------------------------------------------* ---> 001191 GO TO OPTIONS. PP 5655-G53 IBM Enterprise COBOL for z/OS and OS/390 3.1.0 CAMRCOB2 LineID ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+ 0018 001192 INITIALIZE-TABLE. 0018 001193 MOVE SUB-1 TO STATE-NUMBER (SUB-1),

Action:

Execute CAMRCOB2 by entering the command: GO and pressing Enter.

Result:

The ADD statement is executed, and then the application halts execution and displays a Step Count Intercept panel. The line below the ADD statement is now the current line, and is highlighted.

Remove the Step Count and Keep Window

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 CAMRCOB2 by entering go.

Result:

CAMRCOB2 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.

Option 7: Histogram Report

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:

CAMRCOB2 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 CAMRCOB2 at an unconditional breakpoint set at the program exit. The PGM Exit Intercept panel displays in the following panel.

The following screen shows the Program Exit Breakthrough Intercept panel:

CAMRCOB2 ---------- CA InterTest™ Batch PGM EXIT Intercept -------------------- COMMAND ===> SCROLL ===> CSR TRACE=> 000975 000974 000973 001277 001310 001309 001308 001318 001317 001316 0001 000974 CLOSE REPORT-OUT. ---> 000975 GOBACK. 000976 000977 * -----------------------------------------------* 000978 * The " UNCOND ALL EXIT " ( or " AT ALL EXIT " ) * 000979 * command will cause an Unconditional Breakpoint * 000980 * at a program's exit point.. .. * 000981 * -----------------------------------------------* 000982 0001 000983 OPTIONS-MENU. 000984 * -----------------------------------------------* 000985 * Initialise the lengths in case of recursion .. * 000986 * -----------------------------------------------* 0001 000987 CALL 'ISPLINK' USING DSPLY, 000988 COBDPN70. 000989 0001 000990 MOVE 4 TO OPTION-OPTAID. 0001 000991 CALL 'ISPLINK' USING VCOPY, 000992 VCOPY-OPTION-LIST, 000993 VCOPY-OPTION-LENGTHS,

This type of unconditional breakpoint is set with the command: UNCOND ALL EXIT or AT ALL EXIT. 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'

View the Histogram Report

The report is written to the data set associated with the ddname INT1REPT that you can view by splitting the screen.

Action:

ISPF users:
Tab a few lines down your screen and press the SPLIT PF key defined in your ISPF profile (normally PF2).

CA Roscoe users:
Enter the CA Roscoe SPLIT sequence.

Result:

ISPF users:
The ISPF Main Menu displays in the split-screen area.

CA Roscoe users:
A second CA Roscoe panel displays.

 

Action:

ISPF users:
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

CA Roscoe users:
Use CA Roscoe Attach DSN command to display the data set member associated with the ddname INT1REPT. The suggested data set name was: userid.INT1REPT .

Note: In the following example, the data set name is: intbatch.histrept.

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 Dataset Member:

CAMRCOB2 ---------- CA InterTest™ Batch PGM EXIT- HISTOGRAM SUCCESSFULLY WRITTEN COMMAND ===> SCROLL ===> CUR TRACE=> 000975 000974 000973 001277 001310 001309 001308 001318 001317 001316 0001 000974 CLOSE REPORT-OUT. . . . . . . . . . . . . . . . . . . . . . . . . . . BROWSE -- USER99 _TSU04928 ------------------------- Line 00000000 Col 001 080 Command ===> Scroll ===> PAGE ********************************* Top of Data ********************************** 1CA InterTest/Batch Execution Histogram For Program-ID: CAMRCOB2 Date 0 000876 0001 |* 000877 0001 |* 000887 0001 |* 000888 0001 |* 000890 0001 |* 000891 0001 |* 000892 0001 |* 000896 0002 |** 000897 0002 |** 000898 ---- | 000900 0002 |** 000901 0002 |** 000902 0001 |*

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 Histogram Report:

CAMRCOB2 ---------- CA InterTest™ Batch PGM EXIT- HISTOGRAM SUCCESSFULLY WRITTEN COMMAND ===> SCROLL ===> CUR TRACE=> 000975 000974 000973 001277 001310 001309 001308 001318 001317 001316 0001 000974 CLOSE REPORT-OUT. . . . . . . . . . . . . . . . . . . . . . . . . . . BROWSE -- USER99 _TSU04928 ------------------------- Line 00000246 Col 001 080 Command ===> Scroll ===> PAGE 001310 0017 |***************** 001311 ---- | 001312 ---- | 001313 ---- | 001314 0034 |********************************** 001315 0034 |********************************** 001316 0034 |********************************** 001317 0034 |********************************** 001318 0034 |********************************** ----+----|----+----|----+----|----+----|----+----|----+----|----+ 0 *NOTE* ASTERISKS REPRESENT A SCALE OF 00000001 EXECUTION(S) PER AS 1CA InterTest/Batch Execution Histogram For Program-ID: CAMRCOB2 Date -Session Number: 1,175For Userid USER99 -Number of executable statements: 236 0Number of statements executed during this test: 116 0Percentage of statements executed during this test: 49

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, the unexecuted code starts at line 1311. Note the corresponding line number in your program that is unexecuted.

Action:

ISPF users:

Remove your split-screen using the command: x

CA Roscoe users:

Use the CA Roscoe END key to end the second session.

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 1311

Press Enter.

Result:

The application displays the requested line of code.

The following screen displays the unexecuted code:

CAMRCOB2 ---------- CA InterTest™ Batch PGM EXIT Intercept -------------------- COMMAND ===> SCROLL ===> CUR TRACE=> 000975 000974 000973 001277 001310 001309 001308 001318 001317 001316 ---> 001311 990-INITIALISE. ---> 001312 MOVE SPACES TO DM-TEXT. ---> 001313 MOVE ZEROES TO DM-RC. 0034 001314 990-INCREMENT. PP 5655-G53 IBM Enterprise COBOL for z/OS and OS/390 3.1.0 CAMRCOB2 LineID ----+-*A-1-B--+----2----+----3----+----4----+----5----+----6----+ 0034 001315 IF TABLE-SUB LESS THAN 50 0034 001316 ADD 1 TO TABLE-SUB. 0034 001317 990-INCREMENT-EX. 0034 001318 EXIT. PP 5655-G53 IBM Enterprise COBOL for z/OS and OS/390 3.1.0 CAMRCOB2 An "M" preceding a data-name reference indicates that the data-name is mo DEFINED CROSS-REFERENCE OF DATA NAMES REFERENCES 000021 ASA-CNTL 000849 A1 M1181 1184 000646 BALANCE-LINE M1299 000640 BALANCE-OUT 000638 BALANCE-REPORT M1298

By reviewing the code, you determine whether or not it is required. In this case, it is not required for the program and should be removed.

To remove the code in 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 CAMRCOB2 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 command GO.

Result:

If you are continuing the demo, CAMRCOB2 program execution continues with the display of the Advanced Options Menu. Choose another option from the menu.

or

If you are exiting the demo, CAMRCOB2 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, letting you begin testing again, or exit. Use PF3 to exit.