restart logic for a COBOL program doing some file operations?

All sort of Mainframes Interview Questions.
Previous topicNext topic

Topic Author
Binamra
Registered Member
Posts: 40
Joined: Mon Jun 17, 2013 10:42 pm
Zodiac: Sagittarius

restart logic for a COBOL program doing some file operations?

Post by Binamra » Fri Nov 10, 2017 9:19 am

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




enrico-sorichetti
Global Moderator
Global Moderator
Posts: 874
Joined: Wed Sep 11, 2013 3:57 pm

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

Post by enrico-sorichetti » Fri Nov 10, 2017 2:08 pm

if job fails just before last record, it's waste of MIPS. How to handle this in COBOL?
even the most stupid of the interviewers should know that nowadays it is MUCH cheaper to rerun a failed job from the beginning
rathe that implementing a stressful/complicated CHECKPOINT/RESTART system

BTDTGTTS... after a time consuming analysis and a quick prototyping we found that the cost of the approach was too high

PS.
there are lots debatable questions that are asked only to be able - afterwards - to steer the interview results to some <direction> ( hire/not hire )
this one is just one of those
organisations who use this approach should be blacklisted :mrgreen:


cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)

User avatar

Robert Sample
Global Moderator
Global Moderator
Posts: 1331
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
Zodiac: Virgo

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

Post by Robert Sample » Fri Nov 10, 2017 5:57 pm

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.




Topic Author
Binamra
Registered Member
Posts: 40
Joined: Mon Jun 17, 2013 10:42 pm
Zodiac: Sagittarius

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

Post by Binamra » Sat Nov 18, 2017 6:18 pm

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: 119
Joined: Tue Oct 20, 2015 3:20 am
Location: Bloomington, IL

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

Post by Akatsukami » Sat Nov 18, 2017 8:18 pm

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

Previous topicNext topic

Return to “Interview Questions.”