COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-285
USE DEBUGGING
ALL PROCEDURES
traces every procedure-name and appears only once when used. It precludes the
use of any USE procedure statements.
Usage Considerations:
Declarative Procedures
Procedure-names defined within a debugging declarative procedure (and
procedure-names defined within utility sections associated with that declarative
procedure) can be referred to by PERFORM statements located within other
debugging declarative procedures (and utility sections associated with them).
Placement of Debugging Declarative Procedures
Within the Declaratives Portion of the Procedure Division, all debugging declarative
procedures must precede all nondebugging declarative procedures.
DEBUG-ITEM Special Register
A special register, DEBUG-ITEM, is defined for you and available within a USE
DEBUGGING statement. You can choose to display or print the contents of this
register as is or move the fields to your own message description. The point here is
that procedure-names are not automatically displayed as a trace is done. You are
responsible for external evidence of a trace.
Example 9-72. DEBUG-ITEM Special Register
01 DEBUG-ITEM.
05 DEBUG-LINE PIC X(6).
05 FILLER PIC X VALUE SPACE.
05 DEBUG-NAME PIC X(30).
05 FILLER PIC X VALUE SPACE.
05 DEBUG-SUB-1 PIC S9999 SIGN IS LEADING
SEPARATE CHARACTER.
05 FILLER PIC X VALUE SPACE.
05 DEBUG-SUB-2 PIC S9999 SIGN IS LEADING
SEPARATE CHARACTER.
05 FILLER PIC X VALUE SPACE.
05 DEBUG-SUB-3 PIC S9999 SIGN IS LEADING
SEPARATE CHARACTER.
05 FILLER PIC X VALUE SPACE.
05 DEBUG-CONTENTS PIC X(n).