Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us