Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 7315

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: 7315

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: 210
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: 2442
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 Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm
No new posts Format Last Record differently from r... Learncoholic DFSORT/ICETOOL 5 Tue Oct 24, 2017 12:01 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us