Debugging lines missing from production COBOL build logs
29K reputation · 28 Jan 2022, 11:25 UTC
When investigating a failed COBOL deployment, developers often rely on DEBUGGING lines and the USE FOR DEBUGGING declarative to trace program flow through log output. The goal is to retain this diagnostic capability in the production object module without incurring unnecessary size or performance penalties.
However, the inclusion of DEBUGGING lines depends on the WITH DEBUGGING MODE compiler option, and the exact syntax (column‑7 'D' versus *> DEBUG) and availability of the DEBUG‑ITEM register differ between IBM Enterprise COBOL, Micro Focus, and GnuCOBOL. This creates uncertainty about a portable strategy for keeping debugging code enabled across different compilers.
What compiler flags control the inclusion of DEBUGGING lines for each target platform? How does the USE FOR DEBUGGING declarative behave when the debugging mode is disabled? What are the measurable trade‑offs of leaving DEBUGGING lines in the final executable regarding object size and runtime overhead?