Page 1 of 1

File comparison for ESDS.

Posted: Wed Jul 21, 2021 1:01 pm
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,

Re: File comparison for ESDS.

Posted: Wed Jul 21, 2021 7:11 pm
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?

Re: File comparison for ESDS.

Posted: Wed Aug 04, 2021 12:06 am
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?