View previous topic :: View next topic
|
Author |
Message |
zavedali85
New User
Joined: 17 Oct 2008 Posts: 10 Location: Pune
|
|
|
|
Hi All,
my requirement is :
I have to select only those records which have more than 5 duplicates. the sorting is done on a 10 byte long field.
the sorting is done like this
(14,10,ch,eq,c'9823202062')
Please let me know how to extract all the records that have more than 5 duplicates based on the 10 byte long field. |
|
Back to top |
|
|
Senthilkumar k Warnings : 1 New User
Joined: 07 May 2009 Posts: 51 Location: Chennai
|
|
|
|
I thinnk u can write all duplicate records into temp file and use COUNT operator to achive your result. |
|
Back to top |
|
|
Senthilkumar k Warnings : 1 New User
Joined: 07 May 2009 Posts: 51 Location: Chennai
|
|
|
|
Use below count operator to achive ur result.
COUNT FROM(IN5) HIGHER(5) RC4
If RC = 4 means u have more than 5 duplicate records else not. |
|
Back to top |
|
|
Senthilkumar k Warnings : 1 New User
Joined: 07 May 2009 Posts: 51 Location: Chennai
|
|
|
|
Sorry IN5 is your temp file. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
this will select records that occur more than 5 times
Code: |
//STEP0001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=input file
//OUT DD DSN=output file
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(14,10,CH) HIGHER(5)
/*
|
Gerry |
|
Back to top |
|
|
|