Wednesday, December 9, 2009

How to find if a COBOL program is looping, thru Mainview

If you want to know if a program is looping (on mainframe) and if you have Mainview for MVS, then
1. Go to JCPUR which shows realtime job CPU utilization
2. Place the cursor on the job you are interested in and hit enter
3. It'll take you to EZMJOBR window
4. Under SYSPROG Service, you'll find "MVScope CPU Tracing". Place your cursor there and hit enter
5. Then place your cursor on "Begin CPU Trace" and hit enter. It'll start CPU tracing.
6. Once it finishes, see if it shows any one particular statement. If so, it could mean, the program was in a loop during the trace period.
7. Get the Offset info, go to the compile listing and search for the Offset under HEXLOC (you may not find the exact offset, but the one just before this value is good enough). Get the line number and get the statement that was in loop.

Simple?

2 comments:

Ashi said...

Hi Bob, if this blog is still active, could be please post relevant screenshots to understand this ?

Kumaresh T said...

Hi Ashi,

Thanks for your comment. The screenshots cannot be posted here, as it'll show company sensitive information. If you have specific question, or if you are not clear about something, please let me know. I'll try to give a better explanation.

Or, if you don't mind sharing your email id, please post it here, I'll send some screenshots.

Thanks,
Bob