Joined: 20 May 2004 Posts: 97 Topics: 43 Location: hyderabad, India
Posted: Sun Jul 04, 2004 4:26 am Post subject: difference between MERGE & SORT
hi all,
We all know that to MERGE datasets we have to have the individual datasets SORTED, then only we can merge them.
Thus MERGE consists of two steps :
1) Sort the individual datasets.
2) Then merge the datastes.
But the whole process of MERGING can be done in one step using SORT only i.e by using following JCL :
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Sun Jul 04, 2004 5:54 pm Post subject:
As you say, sort is a two-part process whether done externally by you or internally by the sort product. Merge is a one-part process.
If the records in the separate files are already in sorted order, then merge is the more efficient choice. As an example, if you have a large master file that's kept in sorted order and a small transaction file that's kept in sorted order, it would be more efficient to merge the two files rather than sort them. If the large master file is already sorted, but the small transaction file is unsorted, it would probably be more efficient to sort the small transaction file and then merge the two files.
If you have unsorted files and need to sort them together, you can either sort them individually and then merge them, or sort them all at once. Which method is more efficient in that case depends on a lot of factors such as file size, file attributes, and available memory, hiperspace, data space, memory objects and/or space work, etc.
If in doubt, try both methods to see which is more efficient in a given instance. _________________ 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
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