Page 1 of 1

Splitting records using SORT

PostPosted: Fri Oct 09, 2009 10:00 am
by Nary
Hi,

I have a dataset which includes all the original records and duplicate records.
How do I separate original records and duplicate records and place them in two different datasets?

Thank you.
Nary.

Re: Splitting records using SORT

PostPosted: Fri Oct 09, 2009 1:27 pm
by Balamurugan3
Hi

think so this would be useful to you... some time back i was too searching for the same solution..... I got that from another forum...This is using utility ICETOOL ...

   
//STEP1    EXEC PGM=ICETOOL,REGION=1024K                       
//TOOLMSG  DD SYSOUT=*                                         
//DFSMSG  DD SYSOUT=*                                         
//IN   DD DSN=XXX.YYY.INPUT,DISP=SHR                 
//SORTXSUM  DD DSN=XXX.YYY.DUP,DISP=SHR                     
//OUT  DD DSN=XXX.YYY.OUTPUT,DISP=SHR               
//TOOLIN   DD *                                               
  SELECT FROM(IN) TO(OUT) ON(1,3,CH) FIRST DISCARD(SORTXSUM)   
/*                                                             


Here i have mentioned it with use of 1 key.. if so if your file has more than 1 key...

use it like

ON(1,3,CH) ON(4,2,CH)...FIRST DISCARD(SORTXSUM)