Inside COBOL (02 Declaratives – April 1994)

by
SHAWN M. GORDON
PRESIDENT
S.M.GORDON & ASSOCIATES

This month I am going to explain how to set up some simple debugging parameters in your code to help get away from putting in a zillion display statements every time you need to trace your execution. There are some fine debuggers for COBOL on the HP out there, but this assumes you don’t have one.

Although COBOL is the most portable 3GL available today it is important to note that I am making no attempt to show you portable examples. Everything I am showing you, I do on the HP 3000 and no where else. If you are concerned with portability then check in the manual for your other COBOL compiler to see if it works. That said let’s get started.

*
DECLARATIVES.
DEBUG SECTION.
USE FOR DEBUGGING ON ALL PROCEDURES.
000-DEBUG-TRACE.
DISPLAY DEBUG-NAME DEBUG-CONTENTS ” LINE = ” DEBUG-LINE.
END DECLARATIVES.