Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 74
Location: US

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 Remove all Parenthetical Statements -... JayaprakashT DB2 2 Fri Apr 27, 2018 3:57 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
No new posts Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us