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?
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.
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.
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: