Introduction to ENFORM
Controlling the Appearance of the Report
Using ENFORM to Produce Complete Reports
058051 Tandem Computers Incorporated 4–13
In this report, ENFORM uses, as headings, the character string within the quotation
marks and splits the string whenever it encounters a / character.
Using DDL to Establish Default Headings
The DDL record description for the parts file is:
RECORD parts.
FILE IS "$mkt.sample.parts" KEY-SEQUENCED.
02 partnum TYPE *.
02 partname PIC "X(18)".
02 inventory PIC "999S".
02 location PIC "XXX".
02 price PIC "999999V99";
KEY IS partnum.
KEY "pn" IS partname.
END
By using the HEADING attribute of the DDL RECORD statement, the preceding
description can be changed to establish meaningful default headings for the columns
of fields or groups listed on an ENFORM report. Advantages of using this approach
are (1) all ENFORM reports that use the record description will have consistent
headings and (2) it simplifies the query.
For example, to produce the column heading for the report in Figure 4-13 without
using the ENFORM HEADING clause, modify the record description as follows:
RECORD parts.
FILE IS "$mkt.sample.part" KEY-SEQUENCED.
02 partnum TYPE * HEADING "part number".
02 partname PIC "X(18".
02 inventory PIC "999S" HEADING "item/in stock".
02 location PIC "XXX" HEADING "warehouse/location".
02 price PIC "999999V99";
KEY IS partnum.
KEY "pn" is partname.
END
For more information about DDL, see the Data Definition Language (DDL) Reference
Manual.
Using the CENTER Clause
to Center Items Within a
Column
ENFORM automatically right-aligns numeric items and left-aligns character strings
unless you specify a different alignment with the CENTER clause.
For example, entering:
OPEN parts;
LIST partnum HEADING "PART NUMBER" CENTER,
inventory HEADING "ITEMS/IN STOCK",
location HEADING "WAREHOUSE/LOCATION" CENTER;
will generate the report in Figure 4-14.