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 - sum fields=none

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
Salil Pant

New User


Joined: 03 Jun 2009
Posts: 3
Location: India

PostPosted: Wed Jun 03, 2009 6:27 pm    Post subject: sort - sum fields=none
Reply with quote

Hi,

I have a query regarding sum fields none. If I am merging two files into a single file using sort, both the files have unique records but their are some fields common in both the files. Then in output file the records that will be present, will be from first file or from second file?
Back to top
View user's profile Send private message

senjay

Active User


Joined: 10 May 2007
Posts: 147
Location: India

PostPosted: Wed Jun 03, 2009 9:05 pm    Post subject: Reply to: sort - sum fields=none
Reply with quote

Hi,

From 'DFSORT application programming guide',

Quote:
The SUM control statement specifies that, whenever two records are found with equal sort or merge control fields, the contents of their summary fields are to be added, the sum is to be placed in one of the records, and the other record is to be deleted. If the EQUALS option is in effect the first record of summed records is kept. If the NOEQUALS option is in effect, the record to be kept is unpredictable.


Quote:
NONE or (NONE) eliminates records with duplicate keys. Only one record with each key is kept and no summing is performed.


If you use OPTION EQUALS, then the first record (from first file in your point of view) will be kept and the duplicate (from second file in your point of view) would be deleted when SUM FIELDS=NONE is used.
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 Jun 03, 2009 9:56 pm    Post subject:
Reply with quote

For a merge, if you have EQUALS in effect, the record from the first file will be kept for duplicates. If you have NOEQUALS in effect, the record from either file could be kept. To ensure that the kept records are from the first file, you can use:

Code:

//DFSPARM DD *
  OPTION EQUALS
/*
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts SORT to append Month and YEAR in MMYY... tisamf DFSORT/ICETOOL 1 Wed Mar 08, 2017 4:46 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm


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