Stepping and reviewing program execution (Code Debug CICS COBOL)
Related Topics
In this example, we will use the GO command to execute the program for a specified number of statements.
- Type GO 5 1 in the command line and press Enter. The following actions occur:
- Five statements are executed with a one-second pause between each execution.
- The execution pointer points to the current statement, which is highlighted.
- The keep window displays the variable fields contained in the current statement and those you selected for viewing.
- The screen shows the statements that have executed and the number of steps that are completed.
If you have the trace utility already turned on, press PF17 to transfer to the Program Trace screen (2.4).(following figure). This screen shows the execution flow of your program logic. You can scroll the information.
Program Trace Screen (2.4) Showing Program Logic Flow---------------------------------- PROGRAM TRACE (2.4) -------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CWDEMCB2 CSECT: CWDEMCB2 COMPILED: 09 JUN 2005 - 11.23.01
TERM: 0751 ----------------------------------------------- Before CWDEMCB2.424
=======> TASK(00079) MODULE:CWDEMCB2 CSECT:CWDEMCB2 LANGUAGE:COBOL
000390 CALL 'DFHEI1' USING DFHEIV0
000391 SERVICE LABEL
000392 GO TO 500-MAPERR DEPENDING ON DFHEIGDI.
<BRANCH>
000397 MOVE '..{........ ...00303 ' TO DFHEIV0
000398 CALL 'DFHEI1' USING DFHEIV0 DUMMY-EMP DUMMY-LEN
000399
000400
000401 MOVE DUMMY-PAYEMP1 TO PAYEMP1.
000402 IF PAYEMP1 EQUAL '00001'
<RESUMED TO NEW LOCATION, STATEMENT 402
000402 IF PAYEMP1 EQUAL '00001'
000403 1 MOVE PAYROLL-DATA-EMP001 TO WORK-AREA
000404 1 GO TO 300-EMPLOYEE-PAY-RTN.
<BRANCH>
000421 300-EMPLOYEE-PAY-RTN.
000422 IF WA-TYPE EQUAL 'N' OR 'I' OR 'S'
000423 1 COMPUTE CURR-PAY EQUAL WA-HOURS * WA-RATE
******************************** BOTTOM OF DATA *******************************Press PF18 to display the following figure.
Last 3270 Screen
XCB2 00001 - ENTER EMPLOYEE NUMBER C123
*** COMPUWARE CORPORATION ***
DEMONSTRATION TRANSACTION
ENTER DESIRED EMPLOYEE ABOVE:
00001 - CAUSES ASRA ABEND
00002 - CAUSES AEIM (AND OTHER ABENDS)
00003 - CAUSES A WRITE TO TEMPORARY STORAGE
00004 - STARTS UP XCB2 AS AN ASYNCHRONOUS TASK
00005 - USED TO SHOW MULTIPLE CSECT SUPPORT
00333 - CAUSES A STORAGE VIOLATION OF A SAA
00999 - ENDS NORMALLY- Press Enter to return to the Program Trace screen (2.4).
- Press PF6 (LOCATE *) to return to the Source Listing screen (2.L) and position to the current statement.
Place the cursor on source statement 428, then press PF2 (RUNTO CSR). As shown in following figure, execution will halt on statement 428 for the one-time runto breakpoint, which is deleted automatically after it is taken.
PF2 (RUNTO CSR) on the Source Listing Screen (2.L)---------------------------------- SOURCE LISTING (2.L) ------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CWDEMCB2 ************** RUNTO breakpoint encountered ***************
LV ---- COBOL DATANAME KEEPS ---- -- ATTRIBUTES -- ----+---10----+---20--->
K 02 PAY001-HOURS XXX 040
* 77 CURR-TAXES 9(5)V99 NUM-DIS 0760000
03 PAYEMP1 X(5) 00001
**END**
------ ----------------------------------------------- Before CWDEMCB2.428 ->
000419 GO TO 600-SEND-PAY-MAP.
000420
000421 300-EMPLOYEE-PAY-RTN.
000422 IF WA-TYPE EQUAL 'N' OR 'I' OR 'S'
000423 COMPUTE CURR-PAY EQUAL WA-HOURS * WA-RATE
000424 COMPUTE CURR-TAXES EQUAL CURR-PAY * WA-TAX-RAT
000425 ADD CURR-PAY TO WA-YTD-GRS
000426 ADD CURR-TAXES TO WA-YTD-TAX.
000427
=====> IF PAYEMP1 EQUAL '00001'
000429 MOVE WORK-AREA TO PAYROLL-DATA-EMP001.
000430
000431 IF PAYEMP1 EQUAL '00999'
000432 MOVE WORK-AREA TO PAYROLL-DATA-EMP999.Press PF12 (GO) to resume execution as shown in following figure.
Demonstration Transaction Screen*** COMPUWARE CORPORATION *** C123
DEMONSTRATION TRANSACTION
EMPLOYEE NUMBER: 00001
EMPLOYEE NAME: MR. DAVID ABEND
HOURS WORKED: 040
HOURLY RATE: 9.50
GROSS PAY: 380.00
*** TRANSACTION COMPLETE ***Remember to end the session as described in Exiting Code Debug CICS and Ending a Debugging Session.