compare two files and output a difference report



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

compare two files and output a difference report

Postby kihaho » Tue Jul 08, 2008 7:05 pm

I have 2 files that contain duplicate records.
I'd like to create a new file that contains only single records.
Is there any way to acomplish this?
Thank you!!
kihaho
 
Posts: 19
Joined: Tue May 06, 2008 11:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: compare two files and output a difference report

 

Re: compare two files and output a difference report

Postby dick scherrer » Tue Jul 08, 2008 9:37 pm

Hello,

Is there any way to acomplish this?
Yes, but you need to post something that demonstrates your requirement. Post some sample input from both files and the output you want when that sample input is processed.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: compare two files and output a difference report

Postby kihaho » Wed Jul 09, 2008 7:24 pm

Hi Dick,
Thank you for your reply.
I found a tool to accomplish the above - It's called "Beyond Compare".
Basically, I uploaded the flat files to the hard drive as a text format and ran them through the "Beyond Compare". By selecting "just matching" option gave me the list of the duplicate records. From that list, I've deleted the duplicate records from one of the two original files.
Thank you anyways though!!
kihaho
 
Posts: 19
Joined: Tue May 06, 2008 11:13 pm
Has thanked: 0 time
Been thanked: 0 time

Re: compare two files and output a difference report

Postby dick scherrer » Wed Jul 09, 2008 9:35 pm

You're welcome - good to hear you have a solution :)

As long as the data is small enough to transfer to your local drive, this may suffice.

If you work with larger volumes, you will most likely not be able to use this approach and it would be well to already know how to do the work on the platform where the data resides. . . FWIW.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: compare two files and output a difference report

Postby jayind » Sat Jul 12, 2008 6:01 pm

Hi kihaho,

suggestion: using JCL, merge the files. During merge process, eliminate duplicates (using SUM FIELDS=NONE, hope i am correct in syntax ;) )
jayind
 
Posts: 62
Joined: Wed Apr 23, 2008 1:37 pm
Location: Chennai, India
Has thanked: 0 time
Been thanked: 0 time


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post