SUM control statement

Top  Previous  Next
SUM     FIELDS=[(p,m,f) | (p,m),FORMAT=f | NONE | (NONE) ]

 

The SUM control statement specifies that, whenever two records are found with equal sort or merge control fields, the contents of their summary fields are to be added, the sum is to be placed in the first record, and the other record is to be deleted. The EQUALS or NOEQUALS have no effect, because always the first record is used to summarize.

Field definition

Each field to summarize must be defined providing its position p in the input record, its length m and its format f. If all the fields have the same format, the parameter FORMAT may be used, omitting the format specification for each field.

Possible formats:

Format 

Length 

Description 

BI

2, 4, or 8 bytes

Unsigned binary

FI

2, 4, or 8 bytes

Signed fixed-point

PD

1 to 16 bytes

Signed packed decimal

ZD

1 to 18 bytes

Signed zoned decimal

BL

2, 4 or 8 bytes

Little endian binary