How to skip or activate source lines during a debug session



Is it possible to skip lines of COBOL source code at run-time and activate them when necessary, for instance during a debugging session?


Starting from release 8.1, ACUCOBOL-GT introduced a way to comment source lines out.
These can be activated only when necessary.

To use this new functionality, mark these lines with a "D" in the indicator area at column 7 (or with a "\D" in terminal format).


            MOVE "Begin Program" to ws-text 
            display message box ws-text 

      D     MOVE "Debug this" to ws-text 
      D     display message box ws-text

            MOVE "End Program" to ws-text 
            display message box ws-text


By default, the lines marked with "D" will be considered as commented and will be ignored by the runtime.

To activate these lines, compile the program adding the flag -Sd.

From the ACUCOBOL-GT Version 10.0 Documentation Set > ACUCOBOL-GT User's Guide > Compiler and Runtime > Using the Compiler
Source Options

Setting this -Sd option causes debugging lines marked with D in the indicator area to be treated as normal source lines instead of comment lines.
This is equivalent to supplying the phrase WITH DEBUGGING MODE in the SOURCE-COMPUTER paragraph.

Comment List