SUM Control Statement - mfx - 3.1

Syncsort™ MFX Programmers Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ software
Product
Syncsort™ MFX > MFX
Version
3.1
ft:locale
en-US
Product name
Syncsort™ MFX
ft:title
Syncsort™ MFX Programmers Guide
Copyright
2024
First publish date
2010
ft:lastEdition
2025-02-20
ft:lastPublication
2025-02-20T09:24:15.574000

The SUM control statement allows you to sum numeric fields in records with equal sort/merge keys, place the sum in one record which is retained, and delete the other equally-keyed records. Provided arithmetic overflow does not occur during the summing process, the SUM control statement produces only one record per sort/merge key. The records deleted by SUM can optionally be written to a separate output file.

SUM FIELDS=NONE can be used to delete all but one of the records with equal keys without doing any summing.

SUM can also be specified on the DUPKEYS control statement to perform the same function. The DUPKEYS statement provides additional functions for equally-keyed records such as providing AVG, MAX and MIN values.

The SUM control statement should not be used and will be ignored when FIELDS=COPY is specified on the SORT or MERGE control statement.