ENFORM User's Guide
Example ENFORM Programs
058058 Tandem Computers Incorporated D–11
The following program resets the Option Variable @SUBTOTAL-LABEL. The new
value appears in place of the default value asterisk (*).
Three record descriptions are linked together, creating new logical records. The BY
clause groups the records on the value of ordernum. Notice that ordernum and partnum
require qualification, because they appear in more than one record description.
The AS clause uses the mask format to print partnum with a hyphen. The HEADING
clause overrides the default QUANTITY heading, creating a narrower column width
in the report.
A new report item is created with the arithmetic expression (price * quantity). A
subtotal is printed for the new item, assuming OVER order.ordernum.
The MAX aggregate prints a single maximum value of the arithmetic expression for
each group. The WHERE clause restricts the report to records where ordernum is
between 50 and 70.
?DICTIONARY $mkt.dictry
SET @SUBTOTAL-LABEL TO "SUBTOTAL";
OPEN order, odetail, parts;
LINK order TO odetail VIA ordernum,
parts TO odetail VIA partnum;
LIST BY order.ordernum,
parts.partnum AS M
9-999
,
quantity HEADING "QTY",
price,
(price * quantity) AS M
ZZ,ZZZ,999
.
HEADING "PRICE * QTY", SUBTOTAL, TOTAL,
MAX (price * quantity OVER order.ordernum)
AS M
ZZZ,999
.
HEADING "MAXIMUM/PRICE * QTY",
WHERE order.ordernum EQUAL 50 THRU 70;