|
On Thu, 2005-11-10 at 04:07 -0800, gopal barnwal wrote: > Hi, > > There is a scenario where I have to compare two set of > records of a file which has got 200 fields. Out of > these 200 fields other than the key field if the value > of any field is different then I have to print it. > Something like Rec1 is compared with Rec2 of FileA. > It won't be wise to compare each field with a CASxx or > IFxx in the RPG program for each field. Is there a > way where this can be done in a efficient way. > > Early response will really be appreciated. Yes, I wrote such a tool for a customer a few years ago. * Identify a list of files, and run a program for each one. Mainly, it needs to: * Get a list of fields * Get a list of keys Use the cycle 'matching records' mechanism to examine all records in each set of files, so you can easily tell where filea has a record that fileb doesn't, or where fileb has a record that filea doesn't. Then compare the two records. If they are different, start pulling out each field (using %subst) and compare them. If they differ, then what I did was print each key, and followed it up with each field that was different. It took a couple days to write and test and saved us *loads* of time on an upgrade. Regards, Rich
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.