File comparison for ESDS.

All sort of Mainframes Interview Questions.
Post Reply
Ajay Mallick
New Member
Posts: 7
Joined: Sat Oct 18, 2014 4:56 pm

File comparison for ESDS.

Post by Ajay Mallick »

Hello guys.

Can anybody help me in this question?

Please write a cobol program which will have 2 input files (ESDS). Both files will have some unique records and some duplicates. For simplicity you can assume that the files have only 1 field (name, id, etc). The program should create 2 output files (KSDS). The 1st output file should contain all the unique records from both input files. The 2nd one should contain the duplicate records.

Thanks,
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1898
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: File comparison for ESDS.

Post by Robert Sample »

The question as stated cannot be answered, although I suspect the answer is most likely that it is not possible.

Questions to consider before answering the question:
- Are the files (data sets) sorted? If not, that raises the complexity of the solution.
- Do the data sets have the same record length? If not, then how do you compare them?
- Since KSDS data sets MUST have unique primary keys, you CANNOT store more than a single duplicate in one. If there are two or more duplicates then there is no way to write such a program. Output to an ESDS data set would be easy, though.
-What does this mean: "For simplicity you can assume that the files have only 1 field (name, id, etc)" as mainframe data sets do not have "fields" -- they have bytes that are separated into records that are separated into blocks.
- How many records in each data set?
Shruti Yadav
Registered Member
Posts: 17
Joined: Mon Oct 20, 2014 12:33 pm

Re: File comparison for ESDS.

Post by Shruti Yadav »

I think interviewer was confusing you. For an interview I could have converted input filed to sequential files and run a SORT to get the output. Wouldn't that just work?
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.”