Introduction to ENFORM

Restricting the Information That Appears on a Report
Using ENFORM to Produce Complete Reports
058051 Tandem Computers Incorporated 4–7
Figure 4-5. Sorting Multiple Value Occurrences With BY
SUPPNUM PARTNUM PARTCOST
1 212 92000.00
244 87000.00
6201 5800.00
7301 2400.00
6 4102 14500.00
4103 24500.00
10 7102 6800.00
You can use the BY modifier with descending values as well as ascending values.
When dealing with values you want in ascending order, you must specify ASCD or
BY. (An error occurs if you specify both ASCD and BY for the same field.) When
requesting a sort in descending order with suppressed printing of duplicate values,
you must specify BY and DESC. For example, to generate the report in Figure 4-5 in
descending order you would use the following LIST statement:
>LIST BY DESC suppnum, partnum, partcost;
which will generate the report in Figure 4-6.
Figure 4-6. Sorting Multiple Value Occurrences With BY DESC
SUPPNUM PARTNUM PARTCOST
10 7102 6800.00
6 4102 14500.00
4103 24500.00
1 212 92000.00
244 87000.00
6201 5800.00
7301 2400.00
Restricting the
Information That
Appears on a Report
Occasionally, you need all of the information in a file or all of the fields of a particular
type. More often, you will need to restrict the report to information that meets certain
qualifications; for example, parts that cost more than $9000. ENFORM provides two
clauses that can be used to test a particular field in a file for a condition and then to
either select that field for the report, ignore it, or print something else in place of the
field. The clauses are WHERE and IF/ELSE. For example, entering:
>LIST BY suppnum, partnum, partcost,
WHERE partcost GREATER THAN 9000;
will generate the report in Figure 4-7.