View previous topic :: View next topic
|
Author |
Message |
Sabry Krishnan L
New User
Joined: 30 Dec 2006 Posts: 11 Location: Chennai-India
|
|
|
|
Can any explain me the difference between the MERGE and SORT utility? |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
There is no MERGE utility, just SORT.
Sort re-sequences the input.
Merge combines two (or more) pre-sequenced inputs. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Can any explain me the difference between the MERGE and SORT utility? |
MERGE and SORT are functions of a sort utility (e.g. DFSORT). For a MERGE, each of the data sets to be merged must already be in sorted order by a particular key (or keys) and that key must be used as the MERGE key (or keys). For a SORT, the data sets can be unsorted and can be sorted by any key (or keys) specified as the SORT key (or keys).
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. It also explains the concepts of sorting, merging and copying. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Sabry Krishnan L
New User
Joined: 30 Dec 2006 Posts: 11 Location: Chennai-India
|
|
|
|
Thanks Frank. The explanation gives me more clarity about the both the functions. I will putforth what i got. Using both the functionalityof DFSORT we can concatenate 2 files. In MERGE the files should be sorted under a key where as it is not required in SORT. Am i right? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
In MERGE the files should be sorted under a key where as it is not required in SORT. Am i right? |
Well, you're right that the input files do not have to be in sorted order for a SORT, whereas they do for a MERGE. In either case, you must specify a key on which to sort or merge.
Quote: |
Using both the functionalityof DFSORT we can concatenate 2 files. |
If you're asking if you can use two files for SORT or MERGE, the answer is yes. For SORT, you'd use a SORTIN DD with the two files concatenated:
Code: |
//SORTIN DD DSN=... input file1
// DD DSN=... input file2
|
For MERGE, you'd use a SORTIN01 DD and a SORTIN02 DD:
Code: |
//SORTIN01 DD DSN=... sorted input file1
//SORTIN02 DD DSN=... sorted input file2
|
|
|
Back to top |
|
|
|