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

Remove duplicate records


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

New User


Joined: 17 Mar 2009
Posts: 27
Location: Bangalore

PostPosted: Fri Feb 10, 2012 12:53 pm
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

Moderator Emeritus


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

PostPosted: Fri Feb 10, 2012 2:51 pm
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: 2455
Location: Hampshire, UK

PostPosted: Fri Feb 10, 2012 3:46 pm
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: 27
Location: Bangalore

PostPosted: Fri Feb 10, 2012 3:57 pm
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: 577
Location: USA

PostPosted: Fri Feb 10, 2012 8:19 pm
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 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 Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
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 Remove leading zeroes SYNCSORT 4
Search our Forums:

Back to Top