COBOL Manual for TNS and TNS/R Programs
Debugging Tools
HP COBOL Manual for TNS and TNS/R Programs—522555-006
15-3
Standard COBOL Debugging Tools
The contents of the elementary items within DEBUG-ITEM are:
The contents of DEBUG-CONTENTS depends on the nature of the called procedure:
Elementary Item Contents
DEBUG-LINE Number of source line that called the procedure being traced
DEBUG-NAME First 30 characters of the name of the called procedure (including
any section-name qualifier if the procedure is a paragraph)
DEBUG-SUB-1
DEBUG-SUB-2
DEBUG-SUB-3
Not used
DEBUG-CONTENTS Nonnumeric string varying in size and value (see next table)
Contents of DEBUG-CONTENTS The called procedure is ...
START PROGRAM The first procedure in the program
A procedure name The destination in an ALTER statement
Spaces The destination in a GO TO statement
PERFORM LOOP In a PERFORM loop
SORT INPUT In a SORT input procedure
SORT OUTPUT In a SORT output procedure
USE PROCEDURE In a USE procedure
FALL THROUGH Being executed as a result of fall-through from the
previous procedure
Example 15-1. Use of the DEBUG-ITEM Special Register
...
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
SOURCE-COMPUTER. HP WITH DEBUGGING MODE.
...
PROCEDURE DIVISION.
DECLARATIVES.
TRACE-PROGRAM SECTION.
USE FOR DEBUGGING ON ALL PROCEDURES.
DISPLAY-DEBUG-ITEM.
DISPLAY DEBUG-ITEM.
END DECLARATIVES.
BEGIN-PROCESSING.
...