Friday, February 17, 2006

Cobol : Conditional compile / debug

DISPLAY messages are often useful in a development system but you most certainly don't want them in a production environment.

You can do this by setting a "D" in column 7. From the manual:

"A debugging line is any line with a "D" in column 7. It is only permitted in the program after the OBJECT-COMPUTER paragraph.

A debugging line will be considered to have all the characteristics of a comment line if the WITH DEBUGGING MODE clause is not specified in the SOURCE-COMPUTER paragraph."

e.g. SOURCE-COMPUTER. MainFrame WITH DEBUGGING MODE.

Enjoy!

No comments: