Sample SUM Control Statements - mfx - 3.1

Syncsort™ MFX Programmers Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ Software
Product
Syncsort™ MFX > MFX
Version
3.1
Language
English
ContentType
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Topic type
How Do I
Copyright
2024
First publish date
2010
ft:lastEdition
2024-08-27
ft:lastPublication
2024-08-27T08:14:56.318001
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