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

sort - sum fields=none


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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 Developer


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

PostPosted: Wed Jun 03, 2009 9:56 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top