If there are two files one with 100 records and other with
101 records. we have to find out the one record that is the
odd man out . What are the steps to do it

Answers were Sorted based on User's Feedback



If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / ganapathi

I thing that is not correct.SUM FILEDS = NONE will just
ignore the duplicate records.
For acheving this situation first we need to sort both the
files based on the key.Then we need to compare both the
files based on the key.If it is matches fine else write the
key in to another file.

Is This Answer Correct ?    2 Yes 0 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / rajendran

Append 1 to the first file to the first position
Append 2 to the second file to the first position

Now SORT both the file records with option to sum on the
1st character.

at last the odd man record will be the one whose first
character would be "2" for all other it will be "3".

Please let me know if I went wrong somewhere.

Is This Answer Correct ?    2 Yes 0 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / varatharaj

using read command fetch first record from the file1 and compare that record with all records if file2 if any match occur go to second record in file1 compare like this until end of first1 if anyone with out match we can find that is odd man out in files.....

Is This Answer Correct ?    3 Yes 1 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / prasanna kumar

We can do this by external SORT in JCL
//SORTIN DD DSN=ABC.FILE1 ( that contains of 100 records)
// DD DSN=ABC.FILE2 ( that contains of 101 records)
//SORTOUT DD DSN=ABC.NEWFILE
//SYSIN DD *
SORT FIELDS =(1,4,CH,A) (jst to retreive data in sequence)
SUM FIELDS = NONE ( That eliminates the duplicates and
retrieves the data which is odd in both the files and write
in sort out file)
/*

Any other answers !!!

Is This Answer Correct ?    5 Yes 4 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / arpan

Open File 1 in 3.4.
Give command COMP 'FILE2'. It will give you the extra
record in file2.

Is This Answer Correct ?    1 Yes 0 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / kssb78

1. Use 3.13 option to find the different record

Is This Answer Correct ?    1 Yes 0 No

If there are two files one with 100 records and other with 101 records. we have to find out the one..

Answer / kamal

Hi Presannakumar,
We can't compare two files in dfsort.so u first u merge two files and using dfsort in dfsort some fields equal to none means its coming avoid the duplicates,so we can give extra xsum the particular extra record will store xsum dataset.
sync sort we can esily match.

in cobol program matcing logic program we can use and find.
read 2 file at end.
if eno = eno1
move eno to eno3
write rec
if eno > eno1
perform first-para read
write another file
if eno < eno
perform second-para read
write another file.
now the particular record presend in another file.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More COBOL Interview Questions

Is it possible that the redefines clause has different picture clauses compared to the one it redefined?

0 Answers  


If a sub program is called from mainprogram.I have opened cursor in main program and Fetch the result in subprogram ,Is it possible ?If yes please tell me the reason.

1 Answers  


Should I use STOP RUN in the sub program??why?

6 Answers   Xansa,


what is s013u000 for?

1 Answers   Hewitt,


Why is it necessary that file needs to be opened in I-O mode for REWRITE?

0 Answers  






what is the difference between external and global variables?

1 Answers  


Is it possible to mutliply a comp variable with an comp-3 variable. Will there be any error if i do it?

3 Answers   IBM, UST,


can anybody post me about file-aid and changemen tools pls and give me reference if any mainframe guys are there

0 Answers  


What is the reference modification.

2 Answers  


What is the difference between PIC 9.99 and PIC9v99?

0 Answers  


Hi Devolopers.. i need ur help.. i have 3 years of exp in Manual testing and SQL, next month onwards i shifted in to MAINFRAME TESTING... i have ZERO Knowledge abt mainframes.... PLS SUGGEST ME WHAT I LEARN in AMEERPET? mainframe testing or mainframe total devolopment subject... AS a devoloper u know every thing tester what to do PLSSSSSSSSS help me ITS VERY URGENT...

1 Answers  


how can we code index in an array of cobol pgm?

1 Answers   Wipro,


Categories