Page 1 of 1

Keep only dplicate lines

PostPosted: Tue Mar 27, 2012 5:49 pm
by samb01
Hello,

i would like to keep only duplicate lines one time.

For example, i have this dataset

AAAAA
AAAAA
AAAAA
BBBBB
CCCCC
CCCCC
CCCCC
CCCCC
XXXXX
ZZZZZ
ZZZZZ



i would like to obtain

AAAAA
CCCCC
ZZZZZ



I tried ictool but it dosen't work each time

//ICETOOL EXEC PGM=ICETOOL,REGION=1024K
//* POUR EXTRAIRE QUE LES DOUBLONS EN DOUBLE UNE SEULE FOIS
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(INDD) TO(OUTDD) ON(1,1,CH) FIRSTDUP
//INDD DD *




several lines are missing in the output dataset...


Thanks for your help

Re: Keep only dplicate lines

PostPosted: Tue Mar 27, 2012 10:49 pm
by Frank Yaeger
When I run this DFSORT/ICETOOL job (like yours):

//ICETOOL EXEC PGM=ICETOOL,REGION=1024K                   
//TOOLMSG DD SYSOUT=*                                     
//DFSMSG DD SYSOUT=*                                     
//TOOLIN DD *                                             
SELECT FROM(INDD) TO(OUTDD) ON(1,1,CH) FIRSTDUP           
//INDD DD *                                               
AAAAA                                                     
AAAAA                                                     
AAAAA                                                     
BBBBB                                                     
CCCCC                                                     
CCCCC                                                     
CCCCC                                                     
CCCCC                                                     
XXXXX                                                     
ZZZZZ                                                     
ZZZZZ                                                     
//OUTDD DD SYSOUT=*                                       


OUTDD has:

AAAAA   
CCCCC   
ZZZZZ   


which corresponds to what you said you want. So I don't understand why you would have missing records.

Is the RECFM of your input file FB or VB? If it's VB, you need to use ON(5,1,CH) since the RDW is in positions 1-4. If the RECFM is FB, then there's something you're not telling us. Show the output you got and the output you expected.

Re: Keep only dplicate lines

PostPosted: Tue Apr 03, 2012 5:29 pm
by gokulNmf
You can use simple sort, with sum fields=none, instead of Icetool if you want to perform this operation alone.

Re: Keep only dplicate lines

PostPosted: Tue Apr 03, 2012 5:31 pm
by BillyBoyo
gokulNmf wrote:You can use simple sort, with sum fields=none, instead of Icetool if you want to perform this operation alone.


But you wouldn't want to if the file is already sorted....