Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to get the duplicate records using the DFSORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to get the duplicate records using the DFSORT
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: 1439
Location: Bangalore,India

PostPosted: Thu Sep 27, 2007 2:32 pm    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject:
Reply with quote

BRKS

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

http://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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Thu Nov 08, 2007 12:23 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10327
Location: italy

PostPosted: Thu Nov 08, 2007 12:30 pm    Post subject: Reply to: How to get the duplicate records using the DFSORT
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    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 sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 22 Sun Aug 27, 2017 10:35 pm
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

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us