View previous topic :: View next topic
|
Author |
Message |
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Hi,
I want to completely remove the duplicates and store it in other dataset.
By "completely remove' what I mean is
if suppose I have got 5 duplicates + 2 more diffrent record in my file A.
After running sort I should have 2 records ( which were previously there )
and rest all the 5 records should be moved to dataset B.
If you use XSUM then only 4 records will be moved to dataset B and one record ( out of 5 ) will still remain in dataset A.
Can we do this in sort??
If yes, then how??
Thanks
ap_mainframes |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
What is LRECL & RECFM of the input file?
On what basis you want to compare duplicates ? i.e. fields ..starting from ..up to length...??
Regards,
Priyesh. |
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
LRECL IS 4100.
RECFM IS VB.
I tried using XSUM in that case my sort lloks like
//SYSIN DD *
SORT FIELDS=(8,12,ZD,A)
SUM FIELDS=NONE,XSUM
/*
I want to sum up based on position of 8 to length 12.
ap_mainframes |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
ok, try this DFSORT job to make it.
Code: |
//STEP1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//FILEA DD DSN=HLQ.RECORDS.INPUT,DISP=SHR
//OUT1 DD DSN=HLQ.RECORDS.OUTPUT1,DISP=(,KEEP,DELETE)
//OUT2 DD DSN=HLQ.RECORDS.OUTPUT2,DISP=(,KEEP,DELETE)
//TOOLIN DD *
SELECT FROM(FILEA) TO(OUT1) ON(12,12,ZD) NODUPS
SELECT FROM(FILEA) TO(OUT2) ON(12,12,ZD) ALLDUPS
//* |
Quote: |
I want to sum up based on position of 8 to length 12. |
I have assumed it as a key checking for duplicate.
Regards,
Priyesh. |
|
Back to top |
|
|
ap_mainframes
Active User
Joined: 29 Dec 2005 Posts: 181 Location: Canada
|
|
|
|
Well unfortunately ICETOOL just doesnt work here.
Please suggest. |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Are you using SYNCSORT ?
Show some error messages after running this step.
Regards,
Priyesh. |
|
Back to top |
|
|
satheeshkamal
New User
Joined: 09 Jan 2007 Posts: 28 Location: Chennai
|
|
|
|
Hi,
Since XSUM is not supported in DFSORT, is there any way other than using ICETOOL to store the duplicates in the input file to another file?
The requirement is this...
i/p:
aa
aa
bb
cc
dd
dd
ee
o/p:
aa
bb
cc
dd
ee
Duplicate file o/p:
aa
dd
i searched this whole forum, couldn't find to do this using normal SORT.
i don't have ICETOOL in my shop
i actually thought to raise this as a separate topic, but felt better to post this in this topic (as the topic perfectly matches)
Thanks |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Satheesh,
Quote: |
i don't have ICETOOL in my shop |
DFSORT supports ICETOOL and your shop has DFSORT, I believe this statement is meaning less.
Quote: |
thought to raise this as a separate topic |
Should have done that, instead of raising as a continuation to previous post.
Anyways here is the JCL you are looking for -
Code: |
//STEPNAME EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//SORTIN DD *
AA
AA
BB
CC
DD
DD
EE
/*
//NODUPSS DD SYSOUT=*
//DUPSS DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(SORTIN) TO(NODUPSS) FIRST DISCARD(DUPSS) ON(1,2,CH)
/* |
OP as you expected. |
|
Back to top |
|
|
satheeshkamal
New User
Joined: 09 Jan 2007 Posts: 28 Location: Chennai
|
|
|
|
Murali,
Thank you very much . it got worked!
i am very sorry, i didn't know that DFSORT includes ICEMAN, ICETOOL packages within itself as i am new to this. Sorry about that.
|
|
Back to top |
|
|
|