View previous topic :: View next topic
|
Author |
Message |
CJT
New User
Joined: 02 Aug 2007 Posts: 83 Location: Here
|
|
|
|
I have an input file and i need the output to have unique records based on 2 conditions.
Ex
Output File looks like this
Code: |
111-22-3333AB3045000
111-22-3333XX2345000
121-22-3333CB3045000
131-22-3333DB3045000
|
Output File should have only
111-22-3333AB3045000
121-22-3333CB3045000
131-22-3333DB3045000
The output was filtered on 2 conditions - on the SSN and the amount(here it is 45000) on a specified field. Since rec 1 and rec 2 were not exactly duplicates but were duplicates in these 2 fields (SSN and the amount 45000)
I cannot use Sum fields = none in this case.
Please advise. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I cannot use Sum fields = none in this case. |
Please clarify.
What happens when you run a test with SUM FIELDS=NONE?
Post the jcl and control statements and the informational messages generated by the run. Include the message ids. |
|
Back to top |
|
|
CJT
New User
Joined: 02 Aug 2007 Posts: 83 Location: Here
|
|
|
|
Hi,
when i use Sum fields=none it gives the output as
Code: |
111-22-3333AB3045000
111-22-3333XX2345000
121-22-3333CB3045000
131-22-3333DB3045000
|
So that doesnt help. Can you advise on how to eliminate the duplicate records if the same value is appearing on a particular field? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
To repeat. . . .
Quote: |
Post the jcl and control statements and the informational messages generated by the run. Include the message ids.
|
|
|
Back to top |
|
|
CJT
New User
Joined: 02 Aug 2007 Posts: 83 Location: Here
|
|
|
|
I am sorry i am not allowed to disclose JCL information. I have a requirement and i need to know how to go about it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I am sorry i am not allowed to disclose JCL information. |
Maybe not the "real" jcl, but you could make a copy with the names changed. There is no reason to not post the sort control statements and the messages/ids generated by the run.
If you are unwilling to provide info to help yourself, you may have a longer wait for help |
|
Back to top |
|
|
CJT
New User
Joined: 02 Aug 2007 Posts: 83 Location: Here
|
|
|
|
I got the output using
SORT FIELDS=(13,11,CH,A,47,13,ZD,A)
SUM FIELDS=NONE |
|
Back to top |
|
|
dominickim
New User
Joined: 28 Feb 2007 Posts: 65 Location: NS, CA
|
|
|
|
Code: |
000300 //S1 EXEC PGM=SORT
000400 //SYSPRINT DD SYSOUT=*
000500 //SYSOUT DD SYSOUT=*
000600 //SORTLIB DD DSN=SYS1.SORTLIB,DISP=SHR
000700 //SORTIN DD *
=COLS> ----+----1----+----2----+----3----+----4-
000800 111-22-3333AB3045000
000900 111-22-3333XX2345000
001000 121-22-3333CB3045000
001100 131-22-3333DB3045000
002700 /*
002800 //SORTOUT DD SYSOUT=*
002900 //SYSIN DD *
003000 SORT FIELDS=(1,11,CH,A,16,5,ZD,A)
003100 SUM FIELDS=NONE
003200 /* |
Output
Code: |
111-22-3333AB3045000
121-22-3333CB3045000
131-22-3333DB3045000 |
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I got the output using
SORT FIELDS=(13,11,CH,A,47,13,ZD,A)
SUM FIELDS=NONE |
Good to hear this is working
Why was the original attempt with SUM FIELDS=NONE unsuccessful? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
The output was filtered on 2 conditions - on the SSN and the amount(here it is 45000) on a specified field. Since rec 1 and rec 2 were not exactly duplicates but were duplicates in these 2 fields (SSN and the amount 45000)
I cannot use Sum fields = none in this case. |
This statement makes no sense. Records are duplicates or not depending on whether the SORT fields you specify match. If you specify the two fields you're interested in as the SORT fields, then SUM FIELDS=NONE will only keep one of the duplicates for those matching fields. The fields you don't specify as SORT fields don't have any effect on whether the records are considered to be duplicates. |
|
Back to top |
|
|
|