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

Eliminate duplicate based on condition


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

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue May 05, 2009 12:59 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 05, 2009 1:03 pm
Reply with quote

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

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue May 05, 2009 1:14 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 05, 2009 1:17 pm
Reply with quote

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

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue May 05, 2009 1:22 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 05, 2009 1:37 pm
Reply with quote

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 icon_confused.gif
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue May 05, 2009 2:40 pm
Reply with quote

I got the output using

SORT FIELDS=(13,11,CH,A,47,13,ZD,A)
SUM FIELDS=NONE
Back to top
View user's profile Send private message
dominickim

New User


Joined: 28 Feb 2007
Posts: 65
Location: NS, CA

PostPosted: Tue May 05, 2009 7:10 pm
Reply with quote

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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue May 05, 2009 9:00 pm
Reply with quote

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 icon_smile.gif

Why was the original attempt with SUM FIELDS=NONE unsuccessful?
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 05, 2009 9:21 pm
Reply with quote

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
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 Duplicate several members of/in one l... JCL & VSAM 7
No new posts Newbie Stuck on "Duplicate Datas... TSO/ISPF 5
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
Search our Forums:

Back to Top