View previous topic :: View next topic
|
Author |
Message |
BRKS
New User
Joined: 20 Apr 2007 Posts: 14 Location: pune
|
|
|
|
I have a file containing 19,000,000 records it contains duplicate records. I want the duplicate records in another file (irrespective of the key)
Here is the Example
INPUT FILE is of variable length
aaaaaaaaaaaaa
bbbbbbbbbbbbbbb
cccccccccccccccc
aaaaaaaaaaaaa
ddddddddddddd
eeeeeeeeeeeee
ffffffffffffffffffffffffff
bbbbbbbbbbbbbbb
aaaaaaaaaaaaa
ddddddddddddd
eeeeeeeeeeeee
ffffffffffffffffffffffffff
ddddddddddddd
eeeeeeeeeeeee
cccccccccccccccc
ffffffffffffffffffffffffff
eeeeeeeeeeeee
bbbbbbbbbbbbbbb
OUTPUT file should be like this
aaaaaaaaaaaaa
aaaaaaaaaaaaa
aaaaaaaaaaaaa
bbbbbbbbbbbbbbb
bbbbbbbbbbbbbbb
bbbbbbbbbbbbbbb
cccccccccccccccc
cccccccccccccccc
cccccccccccccccc
ddddddddddddd
ddddddddddddd
ddddddddddddd
eeeeeeeeeeeee
eeeeeeeeeeeee
eeeeeeeeeeeee
ffffffffffffffffffffffffff
ffffffffffffffffffffffffff
ffffffffffffffffffffffffff
Regards
BRKS. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
BRKS,
Code: |
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INFILE DD DSN=I/P FILE ...
//DUPS DD DSN=O/P FILE ...
//TOOLIN DD *
SELECT FROM(INFILE) TO(DUPS) ON(1,5,CH) ALLDUPS
/* |
Assumed key is from col 1 to 5.
Quote: |
i want the duplicate records in another file (irrespective of the key) |
If you want dups at record level, replace '5' in above SELECT statement with your LRECL. |
|
Back to top |
|
|
BRKS
New User
Joined: 20 Apr 2007 Posts: 14 Location: pune
|
|
|
|
Thanks
murmohk1 it is working , it solved my problem |
|
Back to top |
|
|
saptagiri kintali
New User
Joined: 21 Sep 2007 Posts: 20 Location: chennai
|
|
|
|
we can also do this by using ICEMAN
//STEP1 EXEC PGM=ICEMAN
//SORTIN DD DSN=.....
//SORTOUT DD DSN=....
//SORTXSUM DD DSN=........<O/P DASTASET IN WHICH U WANT DUPLICATES>
//SYSIN DD *
SORT FIELDS=(1,5,CH,A)
SUM FIELDS = NONE,XSUM
THANK U,
GIRI |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
saptagiri kintali
XSUM, is SYNCSORT feature.
XSUM will contain the duplicate records only, but not the base record.
Example:
If i/p contains:
and your sort card contains
Code: |
SORT FIELDS=(1,2,CH,A)
SUM FIELDS=NONE,XSUM
|
then the SORTOUT will contain:
and SORTXSUM contains
Where as BRKS wants all the occurance of the duplicate records in the o/p like this
|
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
preeth
New User
Joined: 14 Sep 2006 Posts: 11
|
|
|
|
Hi, i would like to know if its possible to do the same thing, without using iceman and icetool. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Preeth,
Code: |
without using iceman and icetool. |
I believe you are asking without SORT product. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Hi, i would like to know if its possible to do the same thing, without using iceman and icetool. |
what would You propose ???
in IT it is possible to manipulate data any way you want by writing a program !
sort ( syncort / dfsort ) , fileaid, any_utility
are just programs designed to provide general use facilities...
the answer is YES, just write a PROGRAM |
|
Back to top |
|
|
|