Hi
I need to merge two file and I need to remove the duplicates based upon some specific field ( eg class number), but whenever i am doing so, the out put file is getting sorted in the order of the sort field.
But business need is the files should be merged , and the records in the merged file should be in order as they were in the individual file. And also the merged file shud not contain any duplicate records with same class number( the field name i had mentioned above) only.
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
Hi subarna roy,
Let us assume files are with RECFM=F or RECFM=FB and LRECL=80.
Let us assume the class number field starts in position 7 and length 7.
Please check with the following code for your requirement.
Suppose if the class number is in both file1 and file2, the following code will keep only one class number from file1 in output.
Joined: 25 Jun 2007 Posts: 196 Location: Bangalore
Hi subarna roy,
Let us assume files are with RECFM=F or RECFM=FB and LRECL=80.
Let us assume the class number field starts in position 7 and length 7.
Please check with the following code for your requirement.
Suppose if the class number is in both file1 and file2, the following code will keep only one class number from file1 in output.
The above code mentioned by Shankar was working fine, but as per business need we can't use ICETOOL, they r suggesting to use SYNC SORT. Can u pls tell me how I can do it with SYNC SORT or something else ( other than ICE TOOL)
The ICETOOL application should work with SyncSort as well. However, if for some reason, you are prevented from coding PGM=ICETOOL in your shop, try PGM=SYNCTOOL.
As an alternative, you can convert the ICETOOL application to a SORT job: