SORT question



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

SORT question

Postby RJAY » Thu Dec 09, 2010 9:02 am

Hello,

I have a situation where after eliminating dups from the input file using SUM FIELDS = NONE the SORT leaves the sorted file with one unique occurence of the duplicate record. In my case I do not want to see the record left behind in my sorted file. How can I eliminate that..?

For example

Input file contains

XXXXXX
XXXXXX
XXXXXX
YYYYYY
ZZZZZZZ

My ouput sorted file should be as below. I don't want to see any XXXXXX records in the sorted file.
YYYYYY
ZZZZZZZ

Could you please help. Thanks.
RJAY
 
Posts: 3
Joined: Thu Dec 09, 2010 8:53 am
Has thanked: 0 time
Been thanked: 0 time

Re: SORT question

Postby dick scherrer » Thu Dec 09, 2010 9:44 am

Hello,

If you use ICETOOL and specify NODUPS you will get what you want.

Read more here:
http://publib.boulder.ibm.com/infocente ... a40145.htm
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: SORT question

Postby Frank Yaeger » Thu Dec 09, 2010 11:08 pm

RJAY,

Here's a DFSORT/ICETOOL job that will do what you asked for:

//S1    EXEC  PGM=ICETOOL                         
//TOOLMSG DD SYSOUT=*                             
//DFSMSG  DD SYSOUT=*                             
//IN DD DSN=...  input file                   
//OUT DD DSN=...  output file                         
//TOOLIN   DD   *                                 
SELECT FROM(IN) TO(OUT) ON(1,7,CH) NODUPS         
/*                                                 


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. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: SORT question

Postby RJAY » Fri Dec 10, 2010 7:23 am

Thank you Frank. Our shop doesn't use ICETOOL. I used another technique by additng flag to the file. Initialized the field with a value 1. I ran the file through a sort with sum fields to increment the flag when a duplicate is encountered. Any ways I had to load the file to a db2 table. I then eliminated the rows with flags > 1. This worked well for me. Thanks.
RJAY
 
Posts: 3
Joined: Thu Dec 09, 2010 8:53 am
Has thanked: 0 time
Been thanked: 0 time

Re: SORT question

Postby Frank Yaeger » Fri Dec 10, 2010 9:54 pm

Our shop doesn't use ICETOOL.


Then your shop is missing out on a lot of DFSORT's functionality. ICETOOL has been part of DFSORT since 1991!
Here's your opportunity to be a "hero" by learning to use ICETOOL and teaching others at your shop.

If you want to learn DFSORT's ICETOOL, I'd suggest reading through the ICETOOL section of "DFSORT: Getting Started" and the ICETOOL Chapter of "DFSORT Application Programming Guide". You can find all of the DFSORT books at:

http://www.ibm.com/support/docview.wss? ... g3T7000080
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post