ENFORM User's Guide
Specifying Computations for a Report
Developing an ENFORM Query
058058 Tandem Computers Incorporated 3–35
Report:
Part
ORDERNUM Number QUANTITY
-------- ------ --------
21 244 1
2001 2
2403 2
4103 2
--------
* 7
... ... ...
Calculating a Total Use the TOTAL clause to generate a grand total for the values of a numeric element.
The following example generates a grand total for the values of quantity:
OPEN odetail;
LIST BY ordernum,
partnum
quantity TOTAL,
WHERE ordernum LE 21;
Report:
Part
ORDERNUM Number QUANTITY
-------- ------ --------
21 244 1
2001 2
2403 2
4103 2
--------
--------
7
Calculating Percentages Use the PCT clause to calculate percentages for numeric elements. The element for
which the percentage is being calculated need not appear in the report. The following
example shows the PCT clause modifying quantity. ENFORM assumes that the
percentage is to be calculated OVER ALL even though the OVER ALL syntax is
omitted.
OPEN odetail;
LIST BY ordernum,
partnum,
quantity,
quantity PCT AS F5.2;