Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Difference between MERGE and SORT utility?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Difference between MERGE and SORT utility?
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: 3158
Location: Tucson AZ

PostPosted: Tue Jan 02, 2007 6:53 pm    Post subject:
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 Moderator


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

PostPosted: Tue Jan 02, 2007 10:08 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject: Re: Difference between MERGE and SORT utility?
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 Moderator


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

PostPosted: Wed Jan 03, 2007 9:55 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts DB2 - TERMINATE utility vasanthz DB2 5 Mon May 15, 2017 11:49 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us