User guide

Example ENFORM Programs
D–8 058058 Tandem Computers Incorporated
The following program creates two user variables, invcount and counter. These user
variables are both assigned values in the LIST statement.
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 parnum
require qualification, because they appear in more than one record description.
The AS clause uses the mask format to print partnum in two columns. The HEADING
clause overrides the default QUANTITY and INVENTORY headings, creating
narrower column widths for those fields.
The NOPRINT clause suppresses the printing of invcount and counter. These user
variables are calculated and used in the IF/THEN/ ELSE expression. The
IF/THEN/ELSE expression determines which value is be printed in the last column.
The HEADING clause specifies the column title.
The WHERE clause restricts the records that contribute to the report.
?DICTIONARY $mkt.dictry
DECLARE invcount INTERNAL I14;
DECLARE counter INTERNAL I12;
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",
inventory HEADING "INV",
invcount := (inventory + quantity) NOPRINT,
counter := (invcount + 1) NOPRINT,
(IF counter > 0 THEN counter ELSE BLANK) TOTAL
HEADING "INV + QTY + 1/(OMIT NEGATIVES)",
WHERE order.ordernum > 60;