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
 

 

Delete duplicate records

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

New User


Joined: 14 May 2010
Posts: 11
Location: chennai

PostPosted: Sat May 15, 2010 12:56 pm    Post subject: Delete duplicate records
Reply with quote

Hi,

Is there a way to delete duplicate records?

Following is my Sort input..

//SORTIN1 DD *
1234566789
1234384848
2632366334
2834748758
//SORTIN2 DD *
1234566789
2834748758
2948343834


I need my Sort out as

1234384848
2632366334
2834748758

Pls suggest
Back to top
View user's profile Send private message

gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Sat May 15, 2010 3:21 pm    Post subject:
Reply with quote

Hi,

isn't 2834748758 also a duplicate record ?

Gerry
Back to top
View user's profile Send private message
santoshkumarmanilakkoju

New User


Joined: 24 Nov 2009
Posts: 37
Location: Don't know

PostPosted: Sat May 15, 2010 4:16 pm    Post subject:
Reply with quote

Can you be a little clear with your requirement:

As I understand you have two files and you want all the unmatched records to write into a third file.
Back to top
View user's profile Send private message
r arunmoezhi

New User


Joined: 26 Jun 2009
Posts: 32
Location: Chennai

PostPosted: Sat May 15, 2010 4:20 pm    Post subject: Reply to: Delete duplicate records
Reply with quote

Can you be more specific.
Will SORTIN1 file contain duplicates?
Will SORTIN2 file contain duplicates?
After merging both the files and if a duplicate is found, do you want to delete all the instances of the duplicate records or do you want to keep the first duplicate.
Please find below a generic version of sort.


Code:

//S1       EXEC  PGM=ICETOOL                 
//TOOLMSG  DD SYSOUT=*                       
//DFSMSG   DD SYSOUT=*                       
//SORTIN1  DD *                             
1234566789                                   
1234384848                                   
2632366334                                   
2834748758                                   
/*                                           
//SORTIN2  DD *                             
1234566789                                   
2834748758                                   
2948343834                                   
/*                                           
//TEMP     DD DSN=&TEMP,DISP=(MOD,PASS)     
//OUT      DD SYSOUT=*                       
//TOOLIN   DD *                             
COPY FROM(SORTIN1) TO(TEMP)                 
COPY FROM(SORTIN2) TO(TEMP)                 
SELECT FROM(TEMP) TO(OUT) ON(1,10,CH) NODUPS
/*                                           

The keyword 'NODUPS' can be replaced with any of the following:
FIRST
FIRSTDUP

Check if any of the keywords suits your requirement. Or else post a detailed requirement.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Sat May 15, 2010 4:42 pm    Post subject:
Reply with quote

Hi,

no need to copy the files to TEMP

this will give you the same result

Code:
//S1       EXEC  PGM=ICETOOL                     
//TOOLMSG  DD SYSOUT=*                           
//DFSMSG   DD SYSOUT=*                           
//IN       DD *                                   
1234566789                                       
1234384848                                       
2632366334                                       
2834748758                                       
/*                                               
//         DD *                                   
1234566789                                       
2834748758                                       
2948343834                                       
/*                                               
//OUT      DD SYSOUT=*                           
//TOOLIN   DD *                                   
SELECT FROM(IN) TO(OUT) ON(1,10,CH) NODUPS       


Gerry
Back to top
View user's profile Send private message
r arunmoezhi

New User


Joined: 26 Jun 2009
Posts: 32
Location: Chennai

PostPosted: Sat May 15, 2010 5:00 pm    Post subject:
Reply with quote

ya you are right gcicchet. We can concatenate the input files in the JCL itself.
But i deliberately kept them as two seperate DD statements since the requestor did not post a clear requirement.
What if he/she wants to handle duplicates in the two files differentely
Back to top
View user's profile Send private message
rswathi_1208

New User


Joined: 14 May 2010
Posts: 11
Location: chennai

PostPosted: Sat May 15, 2010 10:57 pm    Post subject:
Reply with quote

Thank You all..I used 'SELECT FROM(IN) TO(OUT) ON(1,10,CH) NODUPS' and it worked out for me...
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat May 15, 2010 11:09 pm    Post subject: Reply to: Delete duplicate records
Reply with quote

Good to hear it is working - thank you for posting your solution icon_smile.gif

d
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 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
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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