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

How to get the duplicate records using the DFSORT


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
BRKS

New User


Joined: 20 Apr 2007
Posts: 14
Location: pune

PostPosted: Thu Sep 27, 2007 1:53 pm
Reply with quote

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
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Sep 27, 2007 2:32 pm
Reply with quote

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
View user's profile Send private message
BRKS

New User


Joined: 20 Apr 2007
Posts: 14
Location: pune

PostPosted: Fri Sep 28, 2007 1:46 pm
Reply with quote

Thanks

murmohk1 it is working , it solved my problem
Back to top
View user's profile Send private message
saptagiri kintali

New User


Joined: 21 Sep 2007
Posts: 20
Location: chennai

PostPosted: Fri Sep 28, 2007 4:53 pm
Reply with quote

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
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Sep 28, 2007 5:19 pm
Reply with quote

saptagiri kintali
XSUM, is SYNCSORT feature.
XSUM will contain the duplicate records only, but not the base record.
Example:
If i/p contains:
Code:
AA1
AA2
AA3
DDD

and your sort card contains
Code:
SORT FIELDS=(1,2,CH,A)
SUM  FIELDS=NONE,XSUM
then the SORTOUT will contain:
Code:
AA1
DDD
and SORTXSUM contains
Code:
AA2
AA3


Where as BRKS wants all the occurance of the duplicate records in the o/p like this
Code:
AA1
AA2
AA3
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Sep 28, 2007 6:02 pm
Reply with quote

BRKS

For DFSORT's equivalent of XSUM, see the "Keep dropped duplicate records (XSUM)" Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
preeth

New User


Joined: 14 Sep 2006
Posts: 11

PostPosted: Thu Nov 08, 2007 12:00 pm
Reply with quote

Hi, i would like to know if its possible to do the same thing, without using iceman and icetool.
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Thu Nov 08, 2007 12:23 pm
Reply with quote

Preeth,

Code:
without using iceman and icetool.

I believe you are asking without SORT product.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Nov 08, 2007 12:30 pm
Reply with quote

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
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 Duplicate transid's declared using CEDA CICS 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top