DEBUG-ITEM
The DEBUG-ITEM special register provides information for a debugging declarative procedure about the conditions that cause debugging section execution.
DEBUG-ITEM has the following implicit description:
01 DEBUG-ITEM.
02 DEBUG-LINE PICTURE IS X(6).
02 FILLER PICTURE IS X VALUE SPACE.
02 DEBUG-NAME PICTURE IS X(30).
02 FILLER PICTURE IS X VALUE SPACE.
02 DEBUG-SUB-1 PICTURE IS S9999 SIGN IS LEADING SEPARATE CHARACTER.
02 FILLER PICTURE IS X VALUE SPACE.
02 DEBUG-SUB-2 PICTURE IS S9999 SIGN IS LEADING SEPARATE CHARACTER.
02 FILLER PICTURE IS X VALUE SPACE.
02 DEBUG-SUB-3 PICTURE IS S9999 SIGN IS LEADING SEPARATE CHARACTER.
02 FILLER PICTURE IS X VALUE SPACE.
02 DEBUG-CONTENTS PICTURE IS X(n).
Before each debugging section is executed, DEBUG-ITEM is filled with spaces. The contents of the DEBUG-ITEM subfields are updated according to the rules for the MOVE statement, with one exception: DEBUG-CONTENTS is updated as if the move were an alphanumeric-to-alphanumeric elementary move without conversion of data from one form of internal representation to another.
After updating, the contents of the DEBUG-ITEM subfields are:
- DEBUG-LINE
- The source-statement sequence number (or the compiler-generated sequence number, depending on the compiler option chosen) that caused execution of the debugging section.
- DEBUG-NAME
- The first 30 characters of the name that caused execution of the debugging section. Any qualifiers are separated by the word 'OF'.
- DEBUG-SUB-1, DEBUG-SUB-2, DEBUG-SUB-3
- Always set to spaces. These subfields are documented for compatibility with previous COBOL products.
- DEBUG-CONTENTS
- Data is moved into DEBUG-CONTENTS, as shown in the following table.
Cause of debugging section execution | Statement referred to in DEBUG-LINE | Contents of DEBUG-NAME | Contents of DEBUG-CONTENTS |
---|---|---|---|
procedure-name-1 ALTER reference | ALTER statement | procedure-name-1 | procedure-name-n in TO PROCEED TO phrase |
GO TO procedure-name-n | GO TO statement | procedure-name-n | Spaces |
procedure-name-n in SORT or MERGE input/output procedure | SORT or MERGE statement | procedure-name-n | "SORT INPUT", "SORT OUTPUT", or "MERGE OUTPUT" (as applicable) |
PERFORM statement transfer of control | This PERFORM statement | procedure-name-n | "PERFORM LOOP" |
procedure-name-n in a USE procedure | Statement causing USE procedure execution | procedure-name-n | "USE PROCEDURE" |
Implicit transfer from a previous sequential procedure | Previous statement executed in previous sequential procedure1 | procedure-name-n | "FALL THROUGH" |
First execution of first nondeclarative procedure | Line number of first nondeclarative procedure-name | Name of first nondeclarative procedure | "START PROGRAM" |
|