Introduction to ENFORM

Listing Information From a File Onto a Report
Using ENFORM to Produce Complete Reports
4–4 058051 Tandem Computers Incorporated
The simple form of the OPEN statement is the word OPEN followed by the name of
the description to be opened:
>OPEN parts;
Multiple descriptions can be opened with separate OPEN statements or with a single
OPEN statement in which the names are separated with space or commas:
>OPEN parts;
>OPEN fromsup;
>OPEN supplier, order, odetail;
The files remain open until they are explicitly closed with a CLOSE statement or
implicitly closed by a DICTIONARY command, or until the ENFORM session is
ended. It is advisable to close all files you no longer need after using them.
The CLOSE statement is as simple as the OPEN statement. It is the word CLOSE
followed by the file description name separated by commas or spaces:
>CLOSE region, parts;
Listing Information
From a File Onto a
Report
As you already know, the purpose of ENFORM is to generate reports based on the
contents of data files. ENFORM lets you select the data, organize it, and structure a
report by entering specifications. There are several ENFORM commands, statements,
and clauses that make up complete ENFORM specifications, but the LIST statement is
the core of the product. It is the LIST statement that specifies what is to be reported.
The simplest form of the LIST statement generates a list of an entire file. If headings
for the individual data items are included in the data dictionary, they are included in
the report; otherwise, the names of the individual fields are used as headings. If
formatting controls are included in the dictionary, the report items are formatted.
The LIST statement consists of the word LIST followed by the name of an open file and
ending with a semicolon(;). Because a LIST statement can run to several lines when its
full capability is used, it must be terminated with a semicolon. Without a terminator,
ENFORM does not know when LIST ends. Note that other statements such as OPEN
do not require a terminator. However, the examples in this section show all
statements terminated with a semicolon. Following this practice will help you fix
syntax errors.
Figure 4-2 shows the listing of a complete file from the database (see Figure 4-1) used
throughout this publication. The following ENFORM commands and statements
generated the report:
>OPEN fromsup;
>LIST fromsup;