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
 

 

Need to remove duplicates without sorting

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

New User


Joined: 21 Feb 2007
Posts: 70
Location: bangalore

PostPosted: Thu Nov 03, 2011 8:51 am    Post subject: Need to remove duplicates without sorting
Reply with quote

Hi,

I have an input file which is like

12345
12345
qwerty
23456
23456
asdfgh
56789
56789
qwdfgh

now i want an output file without distrubing the sequence and just eliminating the duplicate record

12345
qwerty
23456
asdfgh
56789
qwdfgh

Can you please suggest on this ?
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Nov 03, 2011 11:01 pm    Post subject:
Reply with quote

Assuming your duplicates always occur together as shown in your example, you can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your 'key' is in positions 1-6, but you can change the ON operand appropriately depending on your actual 'key' positions.

Code:

//S1    EXEC  PGM=ICETOOL                                     
//TOOLMSG DD SYSOUT=*                                         
//DFSMSG  DD SYSOUT=*                                         
//IN DD *                                                     
12345                                                         
12345                                                         
qwerty                                                       
23456                                                         
23456                                                         
asdfgh                                                       
56789                                                         
56789                                                         
qwdfgh                                                       
//OUT DD SYSOUT=*                                             
//TOOLIN DD *                                                 
SELECT FROM(IN) TO(OUT) ON(1,6,CH) FIRST USING(CTL1)         
//CTL1CNTL DD *                                               
  OPTION COPY                                                 
/*


If your input is actually more complicated than you've shown, you need to show all of the possible variations.
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 Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts Efficient sorting chandracdac DFSORT/ICETOOL 5 Sat Oct 22, 2016 3:23 am
No new posts Stripping and Sorting of VB file G SRINIVASA RAO SYNCSORT 5 Wed Sep 14, 2016 1:34 pm
No new posts DFSORT sorting only specific records akodakka DFSORT/ICETOOL 4 Thu Aug 04, 2016 11:24 am


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