Introduction to ENFORM

Statements, Clauses, and Commands
Using ENFORM—The Basics
2–10 058051 Tandem Computers Incorporated
The BY clause allows you to sort data items, for the report, based on the value of a
specified data item. A new group will be printed or displayed each time the data item
changes. For example, if you specify BY suppnum, the report will be formatted in
groups for each individual supplier number in the file and the printing of duplicate
values of the supplier number will be suppressed. BY is included as part of the LIST
statement.
The ASCD clause allows you to specify that an item should appear on the report in
ascending (lowest to highest) order.
An example of using WHERE, BY, and ASCD is entering:
OPEN parts, fromsup;
LINK parts to fromsup VIA partnum;
LIST BY suppnum,
parts.partnum,
ASCD inventory,
WHERE inventory GREATER THAN 0;
to produce a report like the one illustrated in Figure 2-8.
Figure 2-8. Example of Grouping and Sorting Items in a Report
Groups Item Headings and Item Headings SUPPNUM PARTNUM INVENTORY
Items from database 1 244 3
212 7
7301 32
Items from database 6 4103 7
4102 9
In this report:
The rows are sorted (grouped) by suppnum from the fromsup file and the printing
of duplicate values of the supplier numbers is suppressed.
Within a supplier number group, the items are sorted by inventory.
partnum had to be entered as parts.partnum in the query. The reason for this
qualification is that partnum appears in both files and you have to identify which
file to select it from.
Only those inventory items that are greater than 0 in the inventory field of the
fromsup file are printed.