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
 

 

Remove duplicate records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Vamshi Veludandi

New User


Joined: 17 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Fri Feb 10, 2012 12:53 pm    Post subject: Remove duplicate records
Reply with quote

Hi,
I have a requirement where in I need to remove a particular record when ever it appears twice.

Input
Code:

AAA
BBB
$$$
$$$
XXX
$$$
ZZZ


Output
Code:

AAA
BBB
$$$
XXX
$$$
ZZZ


This should happen only for '$$$' . Other records can have duplicates.
Is it possible to get the job done thru SORT/REXX ?
A code snippet for the same would be very much helpful.[/code]
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7255

PostPosted: Fri Feb 10, 2012 2:51 pm    Post subject: Reply to: Remove duplicate records
Reply with quote

Can we get a bit of cliarification?

Doui you only have one value for which you want to remove the duplicates, or are there others?


Code:

In:
$$$
$$$
%%%
%%%
AAA
AAA
$$$
%%%

Out:
$$$
%%%
AAA
AAA
$$$
%%%


Or is it just the one value?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1722
Location: UK

PostPosted: Fri Feb 10, 2012 3:46 pm    Post subject:
Reply with quote

You can do it in any programming language - not just rexx. As for Dfsort - I will leave that to the experts.
Back to top
View user's profile Send private message
Vamshi Veludandi

New User


Joined: 17 Mar 2009
Posts: 23
Location: Bangalore

PostPosted: Fri Feb 10, 2012 3:57 pm    Post subject: Re: Reply to: Remove duplicate records
Reply with quote

Hi,

Its only one value '$$$' for which we need to remove the duplicates. Other duplicates like 'AAA' should remain intact.

Thanks
Vamshi.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Fri Feb 10, 2012 8:19 pm    Post subject:
Reply with quote

Vamshi Veludandi,

You can use a DFSORT job like the following:

Code:
//STEP0001 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
AAA                                                         
BBB                                                         
$$$                                                         
$$$                                                         
XXX                                                         
$$$                                                         
ZZZ                                                         
//SORTOUT  DD SYSOUT=*                                       
//SYSIN    DD *                                             
 OPTION COPY                                                 
 INREC IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,3),PUSH=(81:SEQ=8))   
 OUTFIL OMIT=(1,3,CH,EQ,C'$$$',AND,81,8,ZD,GT,1),BUILD=(1,80)
/*                                                           

OUTPUT
Code:
AAA   
BBB   
$$$   
XXX   
$$$   
ZZZ   

Thanks,
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