View previous topic :: View next topic
|
Author |
Message |
raam2smart
New User
Joined: 31 May 2007 Posts: 19 Location: Chennai
|
|
|
|
Hi,
How to extract non duplicte records from a file thru sort?
If we use SUM FIELDS=NONE, The result will contain one record of the duplicates. My requirement is to extract only non duplicate records ie if duplicate is there for a record then that record should not be there in the output.
Thanks,
raam |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I'm sure there are many examples in the forum, but it's Friday afternoon
and in a good mood
here is an example
Code: |
//STEP0001 EXEC PGM=SYNCTOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD *
1
1
2
//NODUPS DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(NODUPS) ON(1,1,CH) NODUPS
/*
|
Gerry |
|
Back to top |
|
|
raam2smart
New User
Joined: 31 May 2007 Posts: 19 Location: Chennai
|
|
|
|
Thanks Gerry!!!
Is is possible in Syncsort. I'll try getting it from the forum meanwhile if anyone can help me on this, that will be really great. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
And if you are looking for something else (and not the one which Gerry has shown which is actually in the close proximity per the problem description); please post some sample input, expected output along with their LRECL & RECFM. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Quote: |
meanwhile if anyone can help me on this |
. . . did you try the solution from Gerry? |
|
Back to top |
|
|
raam2smart
New User
Joined: 31 May 2007 Posts: 19 Location: Chennai
|
|
|
|
No. We dont have ICETOOL utility to run this? Can this possible in syncsort? |
|
Back to top |
|
|
raam2smart
New User
Joined: 31 May 2007 Posts: 19 Location: Chennai
|
|
|
|
Is it possibel to do this in a sort and not thru SYNCTOOL or ICETOOL? |
|
Back to top |
|
|
anandinmainframe
Active User
Joined: 31 May 2007 Posts: 171 Location: India
|
|
|
|
Raam,
I have used the same condition SUM FIELDS=NONE using SYNCSORT utility and its working fine for me.
Quote: |
If we use SUM FIELDS=NONE, The result will contain one record of the duplicates. My requirement is to extract only non duplicate records ie if duplicate is there for a record then that record should not be there in the output.
|
If a Dataset has 22
22 as input
then output will be 22 if we use the above condition |
|
Back to top |
|
|
raam2smart
New User
Joined: 31 May 2007 Posts: 19 Location: Chennai
|
|
|
|
Ok. Ill explain clearly.
Assume the input file contains the following records.
AAAAA
BBBBB
CCCCC
DDDDD
AAAAA
CCCCC
My output file should contain the following records.
BBBBB
DDDDD
How can we achive this? |
|
Back to top |
|
|
raam2smart
New User
Joined: 31 May 2007 Posts: 19 Location: Chennai
|
|
|
|
If there is duplicates, I dont want even a single record from the duplicates? |
|
Back to top |
|
|
Alissa Margulies
SYNCSORT Support
Joined: 25 Jul 2007 Posts: 496 Location: USA
|
|
|
|
Try this SyncSort for z/OS 1.3 application:
Code: |
//SORT EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SORTIN DD *
AAAAA
BBBBB
CCCCC
DDDDD
AAAAA
CCCCC
//SYSIN DD *
INREC FIELDS=(1:C'001',1,5)
SORT FIELDS=(4,5,CH,A)
DUPKEYS SUM=(1,3,ZD)
OUTFIL OUTREC=(1:4,5),INCLUDE=(1,3,CH,EQ,C'001')
/* |
|
|
Back to top |
|
|
|