Compare two datasets & write matching records to output

This is a Mainframe COBOL forum - you can post your queries on Mainframe COBOL, VS COBOL II, COBOL/370 , Enterprise COBOL

Moderators: dbzTHEdinosauer, Moderator Group

Post Reply
kavi1234
Member
Posts: 1
Joined: Mon Aug 31, 2015 3:34 pm

Compare two datasets & write matching records to output

Post by kavi1234 » Mon Aug 31, 2015 3:45 pm

Hi all,

I have two datasets,
(i) first dataset contains 4 lakh records in the format:
100563gh
100564gb
100578gk
(ii)second dataset contains 46lakh records in the format:
100889hk
100895lg
100961pg

I want to compare these two datasets and find matched and unmatched records.

Please someone guide me to do this.

Thank you.

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Aug 31, 2015 4:07 pm

If you really want to do this in COBOL, ensure the files are in sequence on the key, and implement a "two-file match" program.

It is much easier using SORT's JOINKEYS, where all the coding has been done for you and you just use control cards to apply it.

jessicaamirr
Member
Posts: 2
Joined: Mon Nov 30, 2015 12:19 pm
Location: Chennai
Contact:

Post by jessicaamirr » Mon Nov 30, 2015 12:36 pm

How can i perform this so that



"This method is extremely flexible because the duplicates don't have to be in the same row in both data sets. The duplicates can be anywhere within the data set and this function will still find them."
http://www.traininginsholinganallur.in/ ... ennai.html | http://www.traininginsholinganallur.in/ ... ennai.html :lol:

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Nov 30, 2015 4:31 pm

SPAM

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others