View previous topic :: View next topic
|
Author |
Message |
Salil Pant
New User
Joined: 03 Jun 2009 Posts: 3 Location: India
|
|
|
|
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 |
|
|
senjay
Active User
Joined: 10 May 2007 Posts: 147 Location: India
|
|
|
|
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 |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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 |
|
|
|