Posted: Wed May 09, 2007 5:53 am Post subject: Compare and Split two files using ICETOOL
Hi,
Can we do a record vise comparison in two files using ICETOOL,
In this case, there are two files, Field1 is comon in both the files,
1. If there is a match of the Field1, Field2 and Field3 in both the files then nothing is to be done
2. If Field1 of File A is not present in File B then populate that record to File 1
3. If Field1 of File B is not present in File A then populate that record to File 2
4. If Field1 of File A matches with Field1 of File B but the other fields(Field2 or Field3) are not the same then populate that record to File3
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Wed May 09, 2007 11:56 am Post subject:
Quote:
4. If Field1 of File A matches with Field1 of File B but the other fields(Field2 or Field3) are not the same then populate that record to File3
You show the following output for File3:
Code:
Field1 Field2 Field3
101 aa1 cc0 from FileA
103 aa3 cc1 from FileB
I assumed you really wanted the File A records for this situation, so your output records for File3 should be:
Code:
Field1 Field2 Field3
101 aa1 cc0 from FileA
103 aa3 bb3 from FileA
If you really want the 103 record from File B rather than from File A, you need to explain the rules for that.
Here's a DFSORT/ICETOOL job that will do what you asked for. I assumed your input files have RECFM=FB and LRECL=20, but the job can be changed appropriately.
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
Posted: Mon May 14, 2007 2:58 am Post subject:
Run them both and compare the timings - quicker than waiting for someone else to do it for you. _________________ Utility and Program control cards are NOT, repeat NOT, JCL.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum