Cobol interview question.

All sort of Mainframes Interview Questions.
Post Reply
Barbie Girl
Registered Member
Posts: 20
Joined: Mon Aug 12, 2013 11:06 am

Cobol interview question.

Post by Barbie Girl »

Hi

Interviewer said, suppose there is a sequential file with millions of records, used as i/p. When a job uses this file and due to some data problem the job abends. How can you find out which particular record is the culprit?

My answer was:

I would first look at the abend description then from the compile listing of the program,I will search for the particular verb that has caused problem. Will basically get offset of the instruction. Based on the result of the above I would view the file with its copy book for the location of the particular field using filel-aid, for example the location of the field is 45: Field-Name 45 EQ ' '

Which would get the records that match the value.With an assumption that the field value should not be space.

Please help if it's correct or there are better ways of doing it.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Cobol interview question.

Post by William Collins »

You're answering a different question to the one asked.

Make yourself a little program, which reads a file. Set up the program so it abends on the 10th read (or any number of your choice). Look at the formatted dump to see where you can find it telling you that 10 records were read.
Barbie Girl
Registered Member
Posts: 20
Joined: Mon Aug 12, 2013 11:06 am

Re: Cobol interview question.

Post by Barbie Girl »

Thanks William. I cold not come back. But I don't find myself intelligent enough that I can read the dump the way you tell. Is this the only way to solve it?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Cobol interview question.

Post by Robert Sample »

If there is a dump produced with the ABEND, a section of the dump will list the open files as well as the current record for each.

Also, if the program counts the records read, the dump will include the WORKING-STORAGE and hence you can find the record count in the program data.
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.”