DEBUGGING declarative

Debugging sections are permitted only in the outermost program; they are not valid in nested programs. Debugging sections are never triggered by procedures contained in nested programs.

Debugging sections are not permitted in:

  • A program defined with the recursive attribute

The WITH DEBUGGING MODE clause of the SOURCE-COMPUTER paragraph activates all debugging sections and lines that have been compiled into the object code. See Source language debugging for additional details.

When the debugging mode is suppressed by not specifying the WITH DEBUGGING MODE clause, all USE FOR DEBUGGING declarative procedures and all debugging lines are inhibited.

Automatic execution of a debugging section is not caused by a statement that appears in a debugging section.

Format 2: USE statement for DEBUGGING declarative

Read syntax diagramSkip visual syntax diagramUSEFORDEBUGGINGONprocedure-name-1ALL PROCEDURES
USE FOR DEBUGGING
All debugging statements must be written together in a section immediately after the DECLARATIVES header.

Except for the USE FOR DEBUGGING sentence itself, within the debugging procedure there must be no reference to any nondeclarative procedures.

procedure-name-1
Must not be defined in a debugging session.

Table 1 shows, for each valid option, the points during execution when the USE FOR DEBUGGING procedures are executed.

Any given procedure-name can appear in only one USE FOR DEBUGGING sentence, and only once in that sentence. All procedures must appear in the outermost program.

ALL PROCEDURES
procedure-name-1 must not be specified in any USE FOR DEBUGGING sentences. The ALL PROCEDURES phrase can be specified only once in a program. Only the procedures contained in the outermost program will trigger execution of the debugging section.

Table 1. Execution of debugging declaratives
USE FOR DEBUGGING operand Upon execution of the following, the USE FOR DEBUGGING procedures are executed immediately
procedure-name-1 Before each execution of the named procedure

After the execution of an ALTER statement referring to the named procedure

ALL PROCEDURES Before each execution of each nondebugging procedure in the outermost program

After the execution of each ALTER statement in the outermost program (except ALTER statements in declarative procedures)