The following SUM control statement eliminates equal-keyed records without summing
numeric fields. The XSUM option causes the eliminated records to be written to a data
set defined on the SORTXSUM DD statement.
Figure 1. Sample SUM Control Statement
Records with equal control fields will be eliminated from SORTOUT or SORTOFnn data sets so that only one record is retained.
The following SUM control statement sums two numeric fields on records with equal control fields.
Figure 2. Sample SUM Control Statement
When the control fields are equal, this SUM control statement sums the numeric data in the fields beginning in bytes 20 and 32. Because both fields are in packed decimal format, the FORMAT=PD subparameter is used so that the PD value does not have to be specified for each field.
Comprehensive examples illustrating the SUM control statement are provided in How to Use the MFX Data Utility Features.