View previous topic :: View next topic
|
Author |
Message |
nazia.lalani Warnings : 1 New User
Joined: 20 Mar 2009 Posts: 25 Location: hyderabad
|
|
|
|
Hi,
My requirement is
I have an input file in which there are duplicates depending on iCN number
i want to remove the duplicate and want the last record of all the duplictes
icn=12 bytes
date=10 bytes
ICN paid_date
000000000001 2008-01-01
000000000001 2009-01-01
000000000001 2008-01-01
000000000001 2002-01-01
000000000001 2006-01-01
I want the last record: 000000000001 2006-01-01 |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
//STEP0001 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
000000000001 2008-01-01
000000000001 2009-01-01
000000000001 2008-01-01
000000000001 2002-01-01
000000000001 2006-01-01
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(OUT) ON(1,12,CH) LASTDUP
|
Gerry |
|
Back to top |
|
|
nazia.lalani Warnings : 1 New User
Joined: 20 Mar 2009 Posts: 25 Location: hyderabad
|
|
|
|
THANKS...ITS WORKING FINE |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
nazia.lalani,
If you can have unique key records also in your input, you might want to use LAST instead of LASTDUP. |
|
Back to top |
|
|
|