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
 

 

Extract Duplicate records using SORT/ICETOOL utilities

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

New User


Joined: 24 Aug 2006
Posts: 9

PostPosted: Thu Nov 01, 2007 3:16 pm    Post subject: Extract Duplicate records using SORT/ICETOOL utilities
Reply with quote

Hi Everybody,
Just want to know if it is possible to extract the duplicate record using sort or Icetool or any other Utilities?

Eg.
INPUT:
AAAAAA AAAAAAAAAAAAAAAAA11
AAAAAA AAAAAAAAAAAAAAAAA12
AAAAAA AAAAAAAAAAAAAAAAA23
AAAAAB AAAAAAAAAAAAAAAAA11
AAAAAB AAAAAAAAAAAAAAAAA12
AAAAAB AAAAAAAAAAAAAAAAA13
AAAAAC AAAAAAAAAAAAAAAAA11
AAAAAC AAAAAAAAAAAAAAAAA12
AAAAAC AAAAAAAAAAAAAAAAA13

OUTPUT:
AAAAAA AAAAAAAAAAAAAAAAA12
AAAAAA AAAAAAAAAAAAAAAAA23
AAAAAB AAAAAAAAAAAAAAAAA12
AAAAAB AAAAAAAAAAAAAAAAA13
AAAAAC AAAAAAAAAAAAAAAAA12
AAAAAC AAAAAAAAAAAAAAAAA13

Thanks.
Back to top
View user's profile Send private message

krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Nov 01, 2007 3:27 pm    Post subject:
Reply with quote

joelacs1068
What is the Key Field position and its length?
Back to top
View user's profile Send private message
joelacs1068

New User


Joined: 24 Aug 2006
Posts: 9

PostPosted: Thu Nov 01, 2007 5:29 pm    Post subject:
Reply with quote

Hi krisprems
The key field position is col 1-6 length (6).

Thanks in advance.

joelacs
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Nov 01, 2007 5:44 pm    Post subject: Reply to: Extract Duplicate records using SORT/ICETOOL utili
Reply with quote

joelacs,

Use this sort card for your requirement

Code:
//S1    EXEC  PGM=ICETOOL                                           
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG  DD SYSOUT=*                                               
//IN  DD DSN=HLQ.INPUT,DISP=SHR                                 
//OUT  DD DSN=HLQ.INP1,DISP=(,CATLG,DELETE)                     
//OUT2 DD DSN=HLQ.INP2,DISP=(,CATLG,DELETE)                     
//TOOLIN DD *                                                       
  SELECT FROM(IN) TO(OUT) ON(1,6,CH) FIRST DISCARD(OUT2)             
/*                                                                   



dataset in OUT2 will have the following records

Code:
AAAAAA AAAAAAAAAAAAAAAAA12                 
AAAAAA AAAAAAAAAAAAAAAAA23                 
AAAAAB AAAAAAAAAAAAAAAAA12                 
AAAAAB AAAAAAAAAAAAAAAAA13                 
AAAAAC AAAAAAAAAAAAAAAAA12                 
AAAAAC AAAAAAAAAAAAAAAAA13                 


You didn't mention clearly as to how that output is obtained. I have coded the sort card as per my assumptions.
Back to top
View user's profile Send private message
joelacs1068

New User


Joined: 24 Aug 2006
Posts: 9

PostPosted: Thu Nov 01, 2007 6:32 pm    Post subject:
Reply with quote

Hi Aaru,
your suggestions works fine.. thanks everybody ..
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 01, 2007 10:44 pm    Post subject:
Reply with quote

Code:

SELECT FROM(IN) TO(OUT) ON(1,6,CH) FIRST DISCARD(OUT2) 


joelacs,

Since you only want the discarded records, you don't need to specify TO or the TO DD statement. You can use this DFSORT/ICETOOL job:

Code:

//S1    EXEC  PGM=ICETOOL                                           
//TOOLMSG DD SYSOUT=*                                               
//DFSMSG  DD SYSOUT=*                                               
//IN  DD DSN=...  input file                                 
//OUT DD DSN=...  output file                   
//TOOLIN DD *                                                       
SELECT FROM(IN) ON(1,6,CH) FIRST DISCARD(OUT)             
/* 
Back to top
View user's profile Send private message
joelacs1068

New User


Joined: 24 Aug 2006
Posts: 9

PostPosted: Tue Nov 06, 2007 10:16 am    Post subject:
Reply with quote

Yes Frank, I only need the discarded records. Thanks for your suggestion. It really helps a lot.
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 How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
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 Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am


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