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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
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 Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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