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

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: 1788
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 Using ICETOOL, how we can seperate th... bshkris SYNCSORT 5 Tue May 09, 2017 8:33 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


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