User guide

Example ENFORM Programs
D–14 058058 Tandem Computers Incorporated
Report:
Customer Part
ORDERNUM Number Number QTY PRICE PRICE * QTY
-------- -------- ------ --- --------- -----------
66 3210 0-244, 1 87000.00 87,000.
3210 1-403, 3 22000.00 66,000.
3210 2-001, 5 1500.00 7,500.
3210 2-403, 8 9600.00 76,800.
... ... ... ... ...
3210 7-301, 2 2400.06 4,800.
-----------
SUBTOTAL 720,200.
122 5635 1-403, 10 22000.00 220,000.
5635 2-002, 10 1000.00 10,000.
5635 2-403, 30 9600.00 288,000.
... ... ... ... ...
5635 5-103, 3 8000.00 24,000.
5635 7-102, 7 68000.05 476,000.
5635 7-301, 8 2400.06 19,200.
-----------
SUBTOTAL 2,241,601.
-----------
-----------
2,961,801.
SUM OF ORDERS = 2,961,801.00
NO OF DIFFERENT PARTS = 23
The following program uses a FIND statement to create a new output file with three
fields. The fields are regnum, regname, and avgsalfor all employees in each region.
Two record descriptions are linked together, creating new logical records. The BY
clause groups the records on the value of regnum. Notice that regnum requires
qualification, because it appears in both region and employee.
?DICTIONARY $mkt.dictry
OPEN, region, employee, region2;
LINK region.manager TO employee.empnum;
FIND region2
(BY region.regnum,
region.regname,
avgsal := AVG(region.salary OVER region.regnum));