Joined: 16 May 2005 Posts: 10 Location: The 'SYSTEM'
I need to compare two files on a field by field basis. The files are basically dumps of DB2 table, and the structure would look like this.
Key Field1 Field2 Field3
What I need to do is to compare the two files which would have the same records for the key elements. However the non key fields would differ in the two files. I would like to compare both the files for each of the Key fields and need to know how many of the non key fields have undergone a change.
Is there some feature of the SORT utility that we can use to do this? Can this be achieved using FILE-AID, ESYTRIEVE, CLIST/REXX or any other way? If so can someone give me the details?
I know this can be done programmatically, bit I am looking at some utility to get this done.
If you need more specific help, show an example of the records in each input file and what you want the output records to look like. Be as specific as possible. For example, if there can be duplicate records in file1, show that in the example, etc. Also, tell us the RECFM and LRECL of the input files, and explain any "rules" you need to use.
Joined: 16 May 2005 Posts: 10 Location: The 'SYSTEM'
I don?t think the links help in solving my problem. I am giving a detailed requirement below:
Say there are two files, Say File 1 and File 2 (both sequential files), with the following contents. The fields are ID (key, char 5), Address (char 5), Status (char 2)
File1
11111 BOSTN AA
22222 RIVER BB
33333 ANDRO CC
44444 MELIN DD
55555 BLOOM EE
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
I'm not sure how you expected to get that specific a solution given what you originally posted. But now that you've explained exactly what you want, I can give you the following DFSORT/ICETOOL job that will do it:
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Quote:
but unfortunately we don?t have the ICETOOL utility. We just have the DFSORT utility.
I don't know what you mean by that. If you have DFSORT, then you have ICETOOL. ICETOOL is a part of DFSORT (has been since 1991) and is shipped with it. Your System Programmers would have had to do something very strange to remove ICETOOL if you have DFSORT.
Why do you say you don't have ICETOOL? Have you tried it? What happened?
Joined: 16 May 2005 Posts: 10 Location: The 'SYSTEM'
Thanks for enlightening me...and sorry for my Ignorance. I concluded that ICETOOL is missing on our system by relying on someones words. However I have not tried out your code yet, I will let you know once i try it.