Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
SORT DUPS ON MULTIPLE CONDITIONS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: SORT DUPS ON MULTIPLE CONDITIONS
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    Post subject: sum fields=none
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 Moderator


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

PostPosted: Wed Mar 19, 2008 9:48 pm    Post subject:
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    Post subject: wow
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
No new posts OC4 in SORT Mohan Kothakota DFSORT/ICETOOL 2 Tue Sep 12, 2017 6:30 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us