Enform Plus Reference Manual
Clauses
Enform Plus Reference Manual—422684-001
5-34
CUM Clause
CUM Clause
The CUM clause allows you to specify printing of a running total for a numeric
target-item either for all the instances of the target-item or for the instances of
the target-item grouped within the each value of a by-item. The syntax of the
CUM clause is:
target-item
is a record name, a field name, a numeric literal, a predefined aggregate, a user
aggregate, an arithmetic expression, an IF/THEN/ELSE expression, a user
variable, or a System Variable clause. The data type of a target-item used in a
CUM clause must be numeric.
by-item
is the name of a field grouped by a BY or BY DESC clause.
CUM With OVER ALL
When you specify the CUM OVER ALL clause, Enform Plus prints a running total in
place of each value of the numeric target-item. When you specify only CUM,
Enform Plus assumes CUM OVER ALL.
CUM With OVER
When you specify the CUM OVER by-item clause, Enform Plus prints a running total
for the instances of the numeric target-item within the by-item in place of the
value of the numeric target-item. The by-item must be previously defined by a
BY or BY DESC clause. The running total begins anew each time the by-item value
changes. The following example prints the running total of all parts for each location:
LIST BY location,
partnum,
inventory,
inventory CUM OVER location;
Part CUM
LOCATION Number INVENTORY INVENTORY
-------- ------ --------- ---------
L98 5103 8 8
5502 6 14
V66 6603 40 40
... ... ... ...
target-item CUM [ OVER ALL ]
[ OVER by-item ]