You can use the SPLICE operator in ICETOOL to get these kind of discompare reports. Refer to the IBM Manuals to get complete info on SPLICE with examples.
There is another way of doing it with simple DFSORT.
Take the first file, append a number say '001' to the end of it using OUTREC.
Take the second file, append another number '002' using OUTREC again.
Now, concatenate the two files above and use the sort statement as below.
Sort fields =(give the key used for comparison)
sum fields = (give the positions of the fields you appended in step1, ZD)
Now, you will get records like this.
--> Present only in first file will have value 001 as such
--> Present only in second file will have value 002 as such
--> Present in both will have the summed value 003.
You can use the INCLUDE statements to get the records you want.
You may also have to use OUTREC to lift off the fields used for compare
Though this may have many steps, you'll find it easier to do.
I think your files have mutiple records for the key that you use for comparison.
--> You will get the unmatched keys by using the method I told you or by using SPLICE
---> You will certainly come know in which file these keys are present by referring to the summed value.
--> Now you can concatenate the file which contains the unmatched keys alone in one file and your input file as the second one with keys in the same position.
Make sure that your source file contains all the fields other than the key and the mismatch file contains only the key+spaces for other fields
--> use the SELECT operator in ICETOOL and specify ALLDUPS so that you get all the records.
SELECT FROM(IN) TO(OUT) ON(2,10,CH) ALLDUPS
--> next step you can eliminate the "key only" records using an INCLUDE as they will be having spaces for the fields other than the key
Joined: 26 Apr 2004 Posts: 4650 Location: Raleigh, NC, USA
Para, the SPLICE and OVERLAY commands are only available in DFSORT. Since the O/P mentioned XSUM, he's using SYNCSORT, which is why this was moved out of the DFSORT Forum. This will require a SYNCSORT or SYNCTOOL solution.