Introduction to ENFORM
Summary of Clauses
Using ENFORM—The Basics
058051 Tandem Computers Incorporated 2–13
Summary of Clauses The previous clauses can be combined with their respective ENFORM statements and
entered as follows:
OPEN parts, fromsup; 0
LINK parts TO fromsup VIA partnum 1
TITLE “Inventory Report” Center; 2
SUBTITLE “XZY Inc.” CENTER 3
LIST by suppnum HEADING “SUPPLIER/NUMBER: 4
parts.partnum HEADING “PART/NUMBER”, 5
inventory HEADING “QUANTITY/IN STOCK”, 6
price HEADING “QUANTITY/IN STOCK”, 7
(price*inventory) HEADING “TOTAL/COST” 8
SUBTOTAL OVER suppnum 9
TOTAL 10
AVG ((price*inventory) OVER suppnum); 11
to produce the report illustrated in Figure 2-10.
In the example, the statements specify the following:
0. Record descriptions of the files involved in the query.
1. Produce a new view by linking the description.
2. The title “Inventory Report” should be printed and centered.
3. The subtitles “XYZ Inc.” should be printed and centered.
4. Sort the report by the field suppnum, print this field (for each record in the linked
file) with a heading of “SUPPLIER NUMBER”, and suppress printing of duplicate
values of this field.
5. Print the partnum field (for each record in the linked file) with a heading of “PART
NUMBER”.
6. Print the inventory field (for each record in the linked file) with a heading of
“QUANTITY IN STOCK”.
7. Print the price field (for each record in the linked file) with a heading of “COST”.
8. Calculate a new item that is the multiple of the price and inventory fields and print
it (for each record in the linked file) with a heading of “TOTAL COST”.
9. Each time the suppnum field changes print a subtotal for all items in the “TOTAL
COST” column of the report.
10. Print a total for all items in the “TOTAL COST” column.
11. For each unique supplier number, calculate and print the average of the ‘TOTAL
COST” items.