ENFORM User's Guide
Example ENFORM Programs
058058 Tandem Computers Incorporated D–13
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 user variables, sumval and cntval, are assigned values. The NOPRINT clause
suppresses the printing of these items.
The WHERE clause restricts the report to records where ordernum is over 60.
The AT END PRINT clause prints information at the end of the report. The SKIP
clause indicates a new line.
?DICTIONARY $mkt.dictry
SET @SUBTOTAL-LABEL TO "SUBTOTAL";
OPEN order, odetail, parts;
DECLARE sumval AS M
ZZZ,ZZZ,999.99
;
DECLARE cntval AS I10;
LINK order TO odetail VIA ordernum,
LINK parts TO odetail VIA partnum;
LIST BY order.ordernum,
custnum,
parts.partnum AS M
9-999
,
quantity HEADING "QTY",
price,
(price * quantity) AS M
ZZ,ZZZ,999
.
HEADING "PRICE * QTY", SUBTOTAL, TOTAL,
sumval := SUM ((price * quantity) OVER ALL) NOPRINT,
cntval := COUNT (UNIQUE parts.partnum) NOPRINT,
WHERE order.ordernum > 60,
AT END PRINT TAB 30 "SUM OF ORDERS = " sumval SKIP 1,
TAB 30 "NO OF DIFFERENT PARTS
= " cntval;