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

SORT DUPS ON MULTIPLE CONDITIONS


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

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed Mar 19, 2008 9:02 pm
Reply with quote

I have a 150 byte FB input file . I need to sort on mulitple conditions and sort out the duplicates.

This is the condition on which the input file should be sorted.

Code:

  INCLUDE COND=((14,11,CH,GE,C'73590002276',AND,
               14,11,CH,LE,C'73590002299'),OR,
              (1,3,CH,EQ,C'SPM'))             


The output I am getting is

SPMDATEHEADER03180808078
SPMDATEHEADER03180808078
SPMDATEHEADER03180808078
SPMDATEHEADER03180808078
SPMDATEHEADER03180808078


I need to see only record out there. Please advise.
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed Mar 19, 2008 9:04 pm
Reply with quote

Code:

//SYSIN    DD *                                     
  SORT FIELDS=COPY                                   
  INCLUDE COND=((14,11,CH,GE,C'73590002276',AND,     
                14,11,CH,LE,C'73590002299'),OR,     
               (1,3,CH,EQ,C'SPM'))                 
  SUM FIELDS=NONE                                   
/*
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: Wed Mar 19, 2008 9:48 pm
Reply with quote

kirankumarj,

Sigh. SUM FIELDS=NONE cannot be used with a COPY operation. It can only be used with a SORT or MERGE operation. That's because SUM FIELDS=NONE eliminates duplicates and we need a key to determine duplicates. COPY does NOT have a key.

If you want to remove duplicates based on the first 24 bytes as the key, replace your SORT FIELDS=COPY statement with:

Code:

   SORT FIELDS=(1,24,CH,A)


Alternatively, you could use the SELECT operator of DFSORT's ICETOOL to do the same thing.
Back to top
View user's profile Send private message
kirankumarj

New User


Joined: 18 Dec 2007
Posts: 51
Location: delaware

PostPosted: Wed Mar 19, 2008 11:09 pm
Reply with quote

Thanks Frank. It works. You know all !!
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts How to load to DB2 with column level ... DB2 6
Search our Forums:

Back to Top