Printing duplicates if they are greater than x



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

Printing duplicates if they are greater than x

Postby shivanshu26shiv » Thu Jun 18, 2015 5:15 pm

My input is like,

XXXA1B10
XXXA1B10
XXXA1B10
XXXA1B10
XXXA1B10
XXXA1B20
XXXA1B20
XXXA1B20

And I need to check if duplicates are more than 4 then print only those using DFSORT,
hence my output will be,

XXXA1B10
XXXA1B10
XXXA1B10
XXXA1B10

Please help,

I used SELECT FROM(IN) TO(OUT) ON(1,08,CH) HIGHER(4) , which is incorrect...hence please help to rectify.
shivanshu26shiv
 
Posts: 33
Joined: Mon Jun 01, 2015 8:45 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Printing duplicates if they are greater than x

Postby BillyBoyo » Thu Jun 18, 2015 5:58 pm

Your SELECT gives you "all records where there are at least four records with the same key".

For your data, you will get five records.

So, what is your actual problem. Can you show what you got which made you think the output was "incorrect"?
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Printing duplicates if they are greater than x

Postby shivanshu26shiv » Thu Jun 18, 2015 6:13 pm

Thanks for explaining Bill,
What I thought it would print is, it should display 4 records. My expected output is shown in the question which is 4 records.
So please tell what I am missing...
shivanshu26shiv
 
Posts: 33
Joined: Mon Jun 01, 2015 8:45 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Printing duplicates if they are greater than x

Postby BillyBoyo » Thu Jun 18, 2015 6:22 pm

You have five input records with the same key, so it will print five, not four.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Printing duplicates if they are greater than x

Postby BillyBoyo » Thu Jun 18, 2015 6:33 pm

Looking back, you specify 4 for the HIGHER. You'll only get those with five or more records for the same key (ie higher than 4).

If you want four or more, you need HIGHER(3).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Printing duplicates if they are greater than x

Postby shivanshu26shiv » Mon Jul 06, 2015 7:42 pm

Got it, thanks :)
shivanshu26shiv
 
Posts: 33
Joined: Mon Jun 01, 2015 8:45 pm
Has thanked: 4 times
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post