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

Extract Duplicate records using SORT/ICETOOL utilities


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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: 1287
Location: Chennai, India

PostPosted: Thu Nov 01, 2007 5:44 pm
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
Reply with quote

Hi Aaru,
your suggestions works fine.. thanks everybody ..
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 01, 2007 10:44 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Duplicate transid's declared using CEDA CICS 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
No new posts Pulling a fixed number of records fro... DB2 2
Search our Forums:

Back to Top