IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Difference between MERGE and SORT utility?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Sabry Krishnan L

New User


Joined: 30 Dec 2006
Posts: 11
Location: Chennai-India

PostPosted: Tue Jan 02, 2007 6:50 pm
Reply with quote

Can any explain me the difference between the MERGE and SORT utility? icon_lol.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jan 02, 2007 6:53 pm
Reply with quote

There is no MERGE utility, just SORT.
Sort re-sequences the input.
Merge combines two (or more) pre-sequenced inputs.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Jan 02, 2007 10:08 pm
Reply with quote

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
View user's profile Send private message
Sabry Krishnan L

New User


Joined: 30 Dec 2006
Posts: 11
Location: Chennai-India

PostPosted: Wed Jan 03, 2007 12:21 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Jan 03, 2007 9:55 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts REASON 00D70014 in load utility DB2 6
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top