Keep only dplicate lines



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

Keep only dplicate lines

Postby samb01 » Tue Mar 27, 2012 5:49 pm

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
samb01
 
Posts: 431
Joined: Mon Nov 16, 2009 7:24 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Keep only dplicate lines

Postby Frank Yaeger » Tue Mar 27, 2012 10:49 pm

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.
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: Keep only dplicate lines

Postby gokulNmf » Tue Apr 03, 2012 5:29 pm

You can use simple sort, with sum fields=none, instead of Icetool if you want to perform this operation alone.
Cheers,
Gokul
User avatar
gokulNmf
 
Posts: 118
Joined: Sat Mar 28, 2009 6:41 pm
Location: India
Has thanked: 2 times
Been thanked: 0 time

Re: Keep only dplicate lines

Postby BillyBoyo » Tue Apr 03, 2012 5:31 pm

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....
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post