Introduction to ENFORM

Specifying Report Arithmetic
Using ENFORM to Produce Complete Reports
058051 Tandem Computers Incorporated 4–15
In this report, the spacing between the first column and the ITEMS IN STOCK column
and WAREHOUSE LOCATION columns has been increased to 5 and 10 spaces
respectively.
ENFORM provides several additional report formatting clauses such as SKIP, TAB,
and NOHEAD which enable you to control the report's appearance in much more
detail than discussed here. For a detailed description of theses clauses, see the
ENFORM Reference Manual.
Specifying Report
Arithmetic
ENFORM clauses can be used to specify the following types of arithmetic operations:
Calculate and print totals and subtotals for the numeric data items in a column on
the report.
Calculate a derived data item that is the result of performing arithmetic operations
on existing fields in the database and print the derived items on the report.
Calculate aggregate values for groups of data items and print the aggregate values
on the report; in this context “aggregate” is used as a noun that means “a type of
data item formed from a collection of other data items.” ENFORM supports a
number of predefined aggregates such as “average,” “count,”, “minimum,” and
“maximum.”
Each of the preceding operations will be illustrated in the following pages by using
examples based on connecting the files names partsup and fromsup. The logical
description produced as a result of the LINK has the following fields:
|partnum|partname|inventory|location|price|.|partnum|suppnum|partcost|
Entering the following statements generates the report in Figure 4-16. This report
contains no items that are the result of arithmetic operations. However, it is a starting
point for describing how to specify report arithmetic.
OPEN parts, fromsup;
LINK parts TO fromsup VIA partnum;
LIST BY suppnum,
parts.partnum,
inventory,
price;