ENFORM User's Guide
Appendix D Example ENFORM Programs
058058 Tandem Computers Incorporated D–1
This appendix contains complete programs illustrating various features of the
ENFORM language. All of the programs use the sample relational data base shown in
Appendix C.
The following example illustrates two ways of specifying a linking relationship
between record descriptions. The first program contains a LINK statement; the second
program contains a WHERE clause. They produce identical reports. Notice that
partnum requires qualification because it appears in both odetail and parts.
The BY clause groups the records on ordernum first, then on partnum.
The AS clause uses the mask format for inventory and price. The format for inventory
uses the decorations feature to print OUT for out of stock and to print blanks for in
stock.
The WHERE clause restricts the report to records where ordernum is less than 30.
?DICTIONARY $mkt.dictry
OPEN odetail, parts;
LINK odetail TO parts VIA partnum;
LIST BY ordernum,
BY odetail.partnum,
partname,
inventory AS "[MA1'OUT ',PA1' '] M
ZZZZZ9
",
price AS M
ZZZZZZ
.,
WHERE ordernum LT 30;
?DICTIONARY $mkt.dictry
OPEN odetail, parts;
LIST BY ordernum,
BY parts.partnum,
partname,
inventory AS "[MA1'OUT ',PA1' '] M
ZZZZZ9
",
price AS M
ZZZZZZ
.,
WHERE odetail.partnum EQUAL parts.partnum
AND ordernum LT 30;
Report:
Part
ORDERNUM Number PARTNAME INVENTORY PRICE
-------- ------ ------------------ --------- -------
21 244 SYSTEM 192KB SEMI 3 87000.
2001 DECIMAL ARITH OUT 100 1500.
2403 MEM MOD 96K MOS 12 9600.
4103 DISK 160MB 7 24500.
25 244 SYSTEM 192KB SEMI 3 87000.
5103 MAG TAPE DR 8/16 8 8000.
6301 ASYNC CONTROLLER OUT 21 2900.
6402 TERM CRT PAGE OUT 32 1500.