View previous topic :: View next topic
|
Author |
Message |
joelacs1068
New User
Joined: 24 Aug 2006 Posts: 9
|
|
|
|
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 |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
joelacs1068
What is the Key Field position and its length? |
|
Back to top |
|
|
joelacs1068
New User
Joined: 24 Aug 2006 Posts: 9
|
|
|
|
Hi krisprems
The key field position is col 1-6 length (6).
Thanks in advance.
joelacs |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
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 |
|
|
joelacs1068
New User
Joined: 24 Aug 2006 Posts: 9
|
|
|
|
Hi Aaru,
your suggestions works fine.. thanks everybody .. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
joelacs1068
New User
Joined: 24 Aug 2006 Posts: 9
|
|
|
|
Yes Frank, I only need the discarded records. Thanks for your suggestion. It really helps a lot. |
|
Back to top |
|
|
|