Execute the program (Code Debug CICS COBOL)
Related Topics
In this example, you have set a breakpoint and selected one data field to be kept. The program is now ready to test.
- Press Clear to return to CICS.
Type XCB2 and press Enter. The first breakpoint in the program is taken.
Source Listing Screen (2.L)------------------------------- SOURCE LISTING (2.L) ---------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CWDEMCB2 CSECT: CWDEMCB2 COMPILED: 09 JUN 2005 - 11.23.01
LV ---- COBOL DATANAME KEEPS ---- -- ATTRIBUTES -- ----+---10----+---20--->
K 02 WA-HOURS 999 NUM-DIS ...
01 DFHEIV0 X(29) ........................
**END**
------ ----------------------------------------------- Before CWDEMCB2.358 ->
000355 *EXEC CICS HANDLE AID
000356 * CLEAR (800-RETURN-TO-CICS)
000357 *END-EXEC.
=====> B MOVE ' 00278 ' TO DFHEIV
000359 CALL 'DFHEI1' USING DFHEIV0
000360 SERVICE LABEL
000361 GO TO 800-RETURN-TO-CICS DEPENDING ON DFHEIGDI
000362 IF EIBCALEN EQUAL ZERO
000363 1 NEXT SENTENCE
000364 ELSE
000365 1 GO TO 200-RECEIVE-INPUT.
000366
000367 100-SEND-INITIAL-SCREEN.
000368 MOVE WS-13 TO PAY13Press PF12 (GO) to continue processing. The transaction screen appears.
- Type 00001 and press Enter. The program stops again at the first statement.
In the previous example, CWDEMCB2 abended because WA-HOURS contained bad data. You resolved the problem by changing the value of WA-HOURS to 040.
Note the value of WA-HOURS. At this point, the field is set to low values. Next, you will use the GO UNTIL command to find out how WA-HOURS was set to $$$. Type GO UNTIL WA-HOURS in the COMMAND line and press Enter. This command tells Code Debug CICS to execute the program until the contents of WA-HOURS changes. Code Debug CICS positions the display at a MOVE statement. You can see that the contents of WA-HOURS has changed.
Notice that this MOVE statement does not directly reference WA-HOURS. WORK-AREA is a group item that contains WA-HOURS. PAYROLL-DATA-EMP001 is also a group item. With Code Debug, you can go to the Working Storage screen (2.3) and take a closer look at this group level to see where the $$$ came from.
Source Listing Screen (2.L)------------------------------- SOURCE LISTING (2.L) ---------------------C024
COMMAND ===> GO UNTIL WA-HOURS SCROLL ===> CSR
MODULE: CWDEMCB2 ****** "UNTIL" condition met, step execution halted *******
LV ---- COBOL DATANAME KEEPS ---- -- ATTRIBUTES -- ----+---10----+---20--->
K 02 WA-HOURS 999 NUM-DIS $$$
01 PAYROLL-DATA-EMP001 GROUP NMR. DAVID ABEND456 MAIN
01 WORK-AREA GROUP NMR. DAVID ABEND456 MAIN
**END**
------ ------------------------------------------------ After CWDEMCB2.403 ->
000400
000401 MOVE DUMMY-PAYEMP1 TO PAYEMP1.
000402 IF PAYEMP1 EQUAL '00001'
====>> 1 MOVE PAYROLL-DATA-EMP001 TO WORK-AREA
000404 1 GO TO 300-EMPLOYEE-PAY-RTN.
000405 IF PAYEMP1 EQUAL '00002'
000406 1 GO TO 900-PROCESS-00002-SELECTION.
000407 IF PAYEMP1 EQUAL '00003'
000408 1 GO TO 950-PROCESS-00003-SELECTION.
000409 IF PAYEMP1 EQUAL '00004'
000410 1 GO TO 960-PROCESS-00004-SELECTION.
000411 IF PAYEMP1 EQUAL '00005'
000412 1 GO TO 970-PROCESS-00005-SELECTION.
000413 IF PAYEMP1 EQUAL '00333'Clear the COMMAND line by pressing Erase EOF.
- Place the cursor on PAYROLL-DATA-EMP001 in the keep window and press PF8 to scroll it to the top of the keep window.
Press PF16 (WS) to display the Working Storage screen (2.3) as shown in following figure.
Working Storage Screen (2.3)-------------------------------- WORKING STORAGE (2.3) -------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CWDEMCB2 CSECT: CWDEMCB2 COMPILED: 09 JUN 2005 - 11.23.01
LV ---- COBOL DATANAME ---------- -- ATTRIBUTES -- ----+---10----+---20--->
01 PAYROLL-DATA-EMP001 GROUP
02 PAY001-TYPE X N
02 PAY001-NAME X(15) MR. DAVID ABEND
02 PAY001-ADDRESS GROUP
03 PAY001-STREET X(12) 456 MAIN ST.
03 PAY001-CITY X(8) HOMETOWN
03 PAY001-STATE XX MI
03 PAY001-ZIP X(5) 48010
02 PAY001-RATE 9(3)V99 NUM-DIS 00950
02 PAY001-DATE-EFF GROUP
03 PAY001-DTEFF-MM XX 01
03 PAY001-DTEFF-DD XX 01
03 PAY001-DTEFF-YY XX 84
02 PAY001-LST-PCT 9(3)V9 NUM-DIS 0110
02 PAY001-TAX-RAT 9(3)V9 NUM-DIS 0200
02 PAY001-YTD-GRS S9(5)V99 NUM-DIS +1500000
02 PAY001-YTD-TAX S9(5)V99 NUM-DIS +0300000
02 PAY001-HOURS XXX $$$- Type K, the keep line command, next to the PAY001-HOURS, 040 over $$$, and press Enter. This changes the value and sets a keep.