Viewing source (Code Debug CICS COBOL)
Related Topics
Use the “fastpath” method to quickly access program source. Type XPED CWDEMCB2 on a blank CICS screen, and press Enter. The Source Listing screen (2.L) appears.
Source Listing Screen (2.L)-------------------------------- SOURCE LISTING (2.L) --------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CWDEMCB2 CSECT: CWDEMCB2 COMPILED: 09 JUN 2005 - 11.23.01
------ --------------------------------------------------------------------->
000353 PROCEDURE DIVISION USING DFHEIBLK DFHCOMMAREA.
000354 000-BEGIN-PROGRAM.
000355 *EXEC CICS HANDLE AID
000356 * CLEAR (800-RETURN-TO-CICS)
000357 *END-EXEC.
000358 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 PAY13.
000369 MOVE '_____' TO PAYEMP1.
000370 MOVE '- ENTER EMPLOYEE NUMBER' TO PAYPROMPT.
000371 MOVE EIBTRNID TO LINE1-TRAN
000372 PAYMSG10-TRAN.During execution, Code Debug CICS automatically displays the data names in the current statement. In addition, you can select any number of data names to be displayed during execution by specifying explicit keeps. Code Debug CICS displays these fields in the keep window of the screen when an abend or a breakpoint occurs. This feature allows you to monitor data names and modify their values during program execution.
A feature called Intelligent Autokeeps is an extension to Code Debug’s autokeep facility. This feature is enabled by default, but can be disabled in your individual profile settings. With Intelligent Autokeeps enabled, if an autokeep variable could be modified by the execution of the current statement, it will be redisplayed in the keep window when you step to the next statement. It is also marked with an asterisk in column 2, as seen in After GO 1 on the Source Listing Screen (2.L). This intellikeep can often eliminate the need to set, then later remove, an explicit keep. The Intelligent Autokeeps feature will not display an autokeep if a duplicate explicit keep has been set.
In the previous example, an abend occurred because the field WA-HOURS contained invalid data. By setting a keep on this field before reexecuting the program, you can view it to monitor its value and check its effect on the program execution.
- To turn on the trace facility, type SET TRACE ON on the COMMAND line and press Enter.
- Type FIND FIRST WA-HOURS on the COMMAND line and press Enter. The display is positioned to the declaration for WA-HOURS.
Type the K line command on the statement number to the left of WA-hours and press Enter. The value of WA-HOURS will appear in the keep window when you execute the program.
Whenever a keep is set, a K is placed on the line where the data is defined, as shown in following figure.
Selecting a Variable to Keep on the Source Listing Screen (2.L)------------------------------- SOURCE LISTING (2.L) ---------------------C024
COMMAND ===> SCROLL ===> CSR
MODULE: CWDEMCB2 ************************ KEEP set *************************
------ --------------------------------------------------------------------->
000084 05 WA-YTD-TAX PIC S9(5)V99.
000085 K 05 WA-HOURS PIC 999.
000086 05 WA-MSG PIC X(26).
000087
000088 01 VSAM-EMP-RECORD.
000089 05 EMP-NUM-KEY PIC X(5).
000090 05 EMP-NAME PIC X(15).
000091 05 EMP-HOURS PIC 999.
000092 05 EMP-TOTPAY PIC 9(5)V99.
000093 05 FILLER PIC X(50).
000094
000095 01 EMP-RECORD-TABLE.
000096 03 EMP-RECORD-TBL OCCURS 5 TIMES.
000097 05 EMP-NUM-KEY-TBL PIC X(5).
000098 05 EMP-NAME-TBL PIC X(15).
000099 05 EMP-HOURS-TBL PIC 999.
000100 05 EMP-TOTPAY-TBL PIC 9(5)V99.
000101
000102 01 EMP-RECORD-LIST.
000103 05 EMP-NUM-LIST PIC X(5).