Page 1 of 1

SORT question

PostPosted: Thu Dec 09, 2010 9:02 am
by RJAY
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.

Re: SORT question

PostPosted: Thu Dec 09, 2010 9:44 am
by dick scherrer
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

Re: SORT question

PostPosted: Thu Dec 09, 2010 11:08 pm
by Frank Yaeger
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

Re: SORT question

PostPosted: Fri Dec 10, 2010 7:23 am
by RJAY
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.

Re: SORT question

PostPosted: Fri Dec 10, 2010 9:54 pm
by Frank Yaeger
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