IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to eliminate duplicate records - DROP THE ENTIRE DUP SET


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Rohan saldanha

New User


Joined: 23 Apr 2010
Posts: 3
Location: Alabama

PostPosted: Tue Jul 15, 2014 7:35 pm
Reply with quote

I need to exclude duplicate records from a file based on a key. The entire set of duplicate records should be excluded. I do not want to retain even one record of the duplicated set.

Example of input file records with first byte as key:

1 John
1 Henry
2 Jane
1 Kyle
3 Doris
3 Kelley
5 Samantha

The output file should contain:

2 Jane
5 Samantha


Thanks,
Ivan
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 15, 2014 7:40 pm
Reply with quote

Have a look at ICETOOL's SELECT operator.
Back to top
View user's profile Send private message
Rohan saldanha

New User


Joined: 23 Apr 2010
Posts: 3
Location: Alabama

PostPosted: Tue Jul 15, 2014 9:39 pm
Reply with quote

There are three records with '1' as the key which should be excluded
There are two records with '3' as the key which should be exclude.

The records with '2' and '5' as keys do not have duplicates and should be included.

I think I have provided an example which accurately depicts what I need.

Typical requirements would want unique records to be retained in the file. I do not want the entire set of duplicated records.

I am not sure how to accomplish this using the 'select' statement in ICETOOL. Any help would be appreciated.

Thanks.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Tue Jul 15, 2014 10:13 pm
Reply with quote

You look at Chapter 7 in the Application Programming Guide. You then find (they are in alphabetical order) the documentation for SELECT and read about the options, any of which may be useful to you in the future.

NODUPS does exactly what you want.

So a simple SELECT, pretty much Example 2 at the end of the description of SELECT, with a different key position and type.

You'll learn nothing if I just paste the example, or you do. So put the effort in to read about SELECT, and maybe a couple of other operators at the same time. That's the way I do it.
Back to top
View user's profile Send private message
magesh23586

Active User


Joined: 06 Jul 2009
Posts: 213
Location: Chennai

PostPosted: Tue Jul 15, 2014 10:37 pm
Reply with quote

Try this and let us know the results.
Code:

//CPYJK EXEC PGM=ICETOOL                       
//TOOLMSG DD SYSOUT=*                           
//SYSOUT DD SYSOUT=*                           
//DFSMSG DD SYSOUT=*                           
//IN1 DD *                                     
1 John                                         
1 Henry                                         
2 Jane                                         
1 Kyle                                         
3 Doris                                         
3 Kelley                                       
5 Samantha                                     
//OUT2 DD SYSOUT=*                             
//TOOLIN DD *                                   
  SELECT FROM(IN1) TO(OUT2) ON(1,1,CH) NODUPS   
Back to top
View user's profile Send private message
Rohan saldanha

New User


Joined: 23 Apr 2010
Posts: 3
Location: Alabama

PostPosted: Wed Jul 16, 2014 1:07 am
Reply with quote

Thanks a lot Bill and Magesh for your assistance. That did work. Did not realize it was that simple..ofcourse after someone tells you.

I have used other more involved options in icetool for other situations but never thought it would be so straight forward for the my current need.

Thanks again for your time.
Back to top
View user's profile Send private message
Ed Goodman

Active Member


Joined: 08 Jun 2011
Posts: 556
Location: USA

PostPosted: Wed Jul 16, 2014 6:11 pm
Reply with quote

Somewhere, Frank Yeager is trying not to shed a little tear of joy that DFSORT has another convert.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 17, 2014 11:59 am
Reply with quote

Quote:

Somewhere, Frank Yeager is trying not to shed a little tear of joy that DFSORT has another convert.


And a lot of tears when the TS moves to a Syncsort site?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts DROP & ALTER PARTITION-PBR DB2 0
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top