restart logic for a COBOL program doing some file operations?

All sort of Mainframes Interview Questions.
Post Reply
Binamra
Registered Member
Posts: 67
Joined: Mon Jun 17, 2013 10:42 pm

restart logic for a COBOL program doing some file operations?

Post by Binamra »

Hi,

Could someone explain me the program/job restart logic for a COBOL program doing some file operations?

Note: This is not COBOL-DB2 restart logic. It's COBOL restart logic which does not involve DB2. Say for ex: a COBOL program reading input file, dropping few records, writing records to 2 output files based on some condition. If input file has 1 million records, if job fails just before last record, it's waste of MIPS. How to handle this in COBOL?

I was asked this question in an interview.

[ Post made via Android ] Image
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1886
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: restart logic for a COBOL program doing some file operations?

Post by Robert Sample »

This organization has some serious issues and you do NOT want to work for it.

If a COBOL program has an ABEND, you find and fix the cause of the ABEND, restore the data sets to their previous state, and rerun the job from the beginning. It is EXTREMELY unlikely that the program is going to ABEND on the next to last record of a million record data set (about 999,999 to 1 odds), but even if it does -- so what? You restore the data sets and rerun the job after fixing the ABEND cause -- the required solution does not depend upon where in the input that the ABEND occurred. I have never yet had an occasion to create a COBOL restart process -- but then, I have only been coding in COBOL for 42 years.
Binamra
Registered Member
Posts: 67
Joined: Mon Jun 17, 2013 10:42 pm

Re: restart logic for a COBOL program doing some file operations?

Post by Binamra »

Hi,

Thanks for the replies. I could not answer this question. I think he was asking that can we do it in COBOL program or not without using any database? What could be the answer, could you please help me with that.
User avatar
Akatsukami
Global Moderator
Global Moderator
Posts: 122
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL
Contact:

Re: restart logic for a COBOL program doing some file operations?

Post by Akatsukami »

The answer is "yes". As both Dr. Sorichetti and Mr. Sample have said, however, it's a stupid and wasteful thing to do.
"I come to the conclusion that, men loving according to their own will and fearing according to that of the prince, a wise prince should establish himself on that which is in his own control and not in that of others." -- Niccolò Machiavelli
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 “Interview Questions.”