Program went in loop.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
User avatar
BobThomas
Registered Member
Posts: 70
Joined: Sat Jun 15, 2013 11:04 am

Program went in loop.

Post by BobThomas »

One of our Job was executing for long in production. It was told that the program executing in the job is gone is loop. Later the support identified that the a COBOL table in program was overflowed and that is why the job went in loop.

Should not the job be abended if the table was overflowed? And when it was overflowed and in case, it writes to a database, is there not a chance that it might write something totally wrong? What is the solution for it?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1896
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Program went in loop.

Post by Robert Sample »

A COBOL program will not ABEND just because a table overflowed -- although depending upon the circumstances, the system may generate a S0C4 storage ABEND (but maybe not). There is a compile option, SSRANGE, that allows runtime checking of tables -- up through Enterprise COBOL V4, runtime option CHECK(ON) is required to use it but V5 and V6 COBOL automatically use runtime checking if SSRANGE is the compile option. There is a performance penalty for using SSRANGE, however.

Yes, if the table overflows it is entirely possible for the program to write garbage to any output (database or file). Whether or not garbage is written will depend upon the program and a generic answer is not possible.
What is the solution for it?
A couple of possibilities exist:
- use SSRANGE checking and take the performance hit
- use table subscript range validation for every place in the program that writes the table, which requires coding changes (possibly extensive)
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”