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

Need to remove duplicates without sorting


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

New User


Joined: 21 Feb 2007
Posts: 72
Location: US

PostPosted: Thu Nov 03, 2011 8:51 am
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 Developer


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

PostPosted: Thu Nov 03, 2011 11:01 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Remove leading zeroes SYNCSORT 4
No new posts How to remove block of duplicates DFSORT/ICETOOL 8
This topic is locked: you cannot edit posts or make replies. Compare files with duplicates in one ... DFSORT/ICETOOL 11
Search our Forums:

Back to Top