Compare two files and write matching records to a file and unmatched to another

Compare two files and write matching records to a file and unmatched to another

I have two files file 1 and file 2 with huge number of records, I want to compare these two files and write the matching records in these files to file3 and unmatching records to file 4.

Can anyone describe the logic of the cobol program to achieve this efficiently?

“; ; ; ;