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
Content type
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Copyright
2024
First publish date
2010
Last updated
2024-11-06
Published on
2024-11-06T17:38:26.716054

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.