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