Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to eliminate duplicate records - DROP THE ENTIRE DUP SET

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to eliminate duplicate records - DROP THE ENTIRE DUP SET
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Jul 15, 2014 7:40 pm    Post subject: Reply to: How to eliminate duplicate records - DROP THE ENTI
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    Post subject: Reply to: How to eliminate duplicate records - DROP THE ENTI
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Jul 15, 2014 10:13 pm    Post subject: Reply to: How to eliminate duplicate records - DROP THE ENTI
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: 159
Location: Chennai

PostPosted: Tue Jul 15, 2014 10:37 pm    Post subject: Reply to: How to eliminate duplicate records - DROP THE ENTI
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    Post subject:
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    Post subject:
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: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Jul 17, 2014 11:59 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us