Page 1 of 1

Help on ICETOOL regarding eliminating rduplicates

PostPosted: Fri Oct 19, 2012 2:59 pm
by dkm1987
Hello everyone,

I need a help on one of my requirement..

I've a PS file with RECFM - FB.(The LRECL will be dynamic) I want to eliminate the duplicates in such a manner, that if there are any duplicate records, then NONE of them should be copied to output file.. am giving a sample scenario below

FILE
----
AAAA
BBBBB
CCCC
AAAA
AAAA
DDDD
BBBBB

Expected o/p
--------------
CCCC
DDDD

Requesting help on this... Thanks in advance ! :)

Re: Help on ICETOOL regarding eliminating rduplicates

PostPosted: Fri Oct 19, 2012 3:14 pm
by BillyBoyo
Have you looked at the documentation for SELECT?

Re: Help on ICETOOL regarding eliminating rduplicates

PostPosted: Fri Oct 19, 2012 9:52 pm
by skolusu
dkm1987,

Use the following DFSORT/ICETOOL JCL which will give you the desired results

//STEP0200 EXEC PGM=ICETOOL                 
//TOOLMSG  DD SYSOUT=*                       
//DFSMSG   DD SYSOUT=*                       
//IN       DD *                             
----+----1----+----2----+----3----+----4----+
AAAA                                         
BBBBB                                       
CCCC                                         
AAAA                                         
AAAA                                         
DDDD                                         
BBBBB                                       
//OUT      DD SYSOUT=*                       
//TOOLIN   DD *                             
  SELECT FROM(IN) TO(OUT) ON(1,5,CH) NODUPS 
//*

Re: Help on ICETOOL regarding eliminating rduplicates

PostPosted: Mon Oct 22, 2012 3:31 pm
by dkm1987
Hi Kolusu,

Thanks for the help ! :)

Re: Help on ICETOOL regarding eliminating rduplicates

PostPosted: Mon Oct 22, 2012 4:15 pm
by dkm1987
Hi Kolusu,

I got the desired o/p... but, one more question.,.. My key will be always the length of the file (starts from 1st pos till last pos). And this varies at run time. So is there a way to code the "ON" field such a way that each time it'll take the max length (LRECL) of the file ?

A help from anyone will be highly appreciated.. Thanks much ! :)

Re: Help on ICETOOL regarding eliminating rduplicates

PostPosted: Mon Oct 22, 2012 5:46 pm
by BillyBoyo
Presumably your records are fixed-length?

There is nothing to directly get you the LRECL of a dataset in the Sort control cards.

You could consider a symbol/SYMNAME for the ON.

That could be generated. If you have a little step with FTOV on OUTFIL (to convet Fixed to Variable) and just put one record on an output file (STOPAFT=1) you would subsequently be able to get at the record-length of that one record, and use it go generate your symbol/SYMNAME with an ending value of 1,2,BI,SUB,+4,TO=ZD,LENGTH=4.

Note that with one ON you are limited to checking 4000 bytes maximum.

Re: Help on ICETOOL regarding eliminating rduplicates

PostPosted: Mon Oct 22, 2012 11:09 pm
by skolusu
dkm1987 wrote:Hi Kolusu,

I got the desired o/p... but, one more question.,.. My key will be always the length of the file (starts from 1st pos till last pos). And this varies at run time. So is there a way to code the "ON" field such a way that each time it'll take the max length (LRECL) of the file ?

A help from anyone will be highly appreciated.. Thanks much ! :)


As bill mentioned you need to change your ON statement for every file you get as input and maximum value is 4000 bytes.

Check this link for detailed explanation of SELECT statement

http://publibz.boulder.ibm.com/cgi-bin/ ... 1CA60/7.14?