Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Source run report

Status
Not open for further replies.

Truusvlugindewind

Programmer
Jun 5, 2002
350
NL
I've worked with various cobol versions the past 20 years. I remember the possibility to get a report, generated at run-time, which gave all sections/paragraphs/statements followed by a counter indicating how many times this was executed.
Nowadays I work with "Enterprise COBOL for z/OS 3.3.1". Is the above mentioned rapporting still around?
 
We had the capability years ago using an optimizer from Computer Associates. It optimized the compile code and provided debugging tools that produced a report like you're talking about.
 
you can add debugging lines in your source and compile with debugging mode. You code the line source-computer with the extra WITH DEBUGGING MODE. The debugging lines have a mark 'D' on column 7. You can simply add a debugging-line display statement after every paragraph. Indead in the old days there was a ready trace. I think in some dialects it is still there, even the exhibit statement is still available, for example in REALIA where a lot of old stuff is supported when you use the REALIA dialect. You can also use many other dialects of course to guarantee compatibility whith the mainframe....

Regards,

Crox
 
As I recall READY TRACE was/is an obsolete language element has been removed from current implementations. When I last I worked in an IBM environment (6-7 yrs ago), I was able to generate a program trace by including a DECLARATIVE section with a DEBUGGING statement. Something like the following (Please check your manuals as I am working strictly from memory here).

Code:
DECLARATIVES.
DEBUG SECTION.
    USE FOR DEBUGGING ON ALL PROCEDURES
DEBUG-TRACE.
    DISPLAY DEBUG-ITEM.
END DECLARATIVES.

DEBUG-ITEM is a special register but I cannot remember whether it require explicit definition or not.

Also don't forget you'll need a
Code:
SOURCE-COMPUTER. computer-name WITH DEBUGGING MODE.

And I believe it required a runtime switch to be turned on:

Code:
//MYSTEP EXEC PGM=MYPROG,PARM="D\"

But once you got all these in place it would print a fairly nice trace to SYSPRINT (or SYSDBUG?). The nice thing about this approach is that it avoided having to add code at each desired trace point (i.e. paragraph entry) to display the current program location. The only drawback is that the debugging section only gets invoked at procedure entry points, not at exits. This can require some extra thought to follow if you adhere to a strict structured programming style, but it's a lot better than nothing.

Code what you mean,
and mean what you code!
But by all means post your code!

Razalas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top