User guide

Connecting Record Descriptions to Form New Relationships
Developing an ENFORM Query
3–18 058058 Tandem Computers Incorporated
You might specify a combination of links if you want to obtain information from the
data files associated with more than two record descriptions. For example, suppose
that you want to produce a report that lists the orders taken by your company, the
price that your company can charge for each ordered part, and the price that your
company must pay for each ordered part. To produce such a report, ENFORM must
obtain information from five record descriptions: order, parts, odetail, fromsup, and
supplier. As the following query specifications show, you could initiate these links
with LINK statements and a WHERE clause:
OPEN order, parts, odetail, fromsup, supplier;
LINK order TO odetail VIA ordernum;
LINK odetail TO parts VIA partnum;
LINK parts TO fromsup VIA partnum;
LIST BY order.ordernum HEADING "No.",
BY partname HEADING "Part",
SUM ((quantity * price) OVER partname) HEADING
"Our/Price",
suppname HEADING "Supplier",
(quantity * partcost) HEADING "Our/Cost"
WHERE fromsup.suppnum = supplier.suppnum;
A sketch of the links in the preceding query appears as follows:
order odetail parts fromsup supplie
r
Because you have linked the record descriptions, ENFORM can build a set of logical
record occurrences from which it produces the target records for the following report
(note: this report has been edited so that it will fit on the manual page):
Our Our
No. Part Price Supplier Cost
--- ----------------- --------- ------------------- --------
21 DECIMAL ARITH 3000.00 TANDEM COMPUTERS 2700.00
DISK 160MB 147000.00 INFORMATION STORAGE 40000.00
MAGNETICS CORP 38600.00
DATADRIVE 39000.00
MEM MOD 96K MOS 19200.00 TANDEM COMPUTERS 18900.00
SYSTEM 192KB SEMI 87000.00 TANDEM COMPUTERS 85000.00
25 ASYNC CONTROLLER 5800.00 TANDEM COMPUTERS 5500.00
MAG TAPE DR 8/16 16000.00 MAGNETICS CORP 6200.00
DATADRIVE 6250.00
SYSTEM 192KB SEMI 87000.00 TANDEM COMPUTERS 83000.00
TERM CRT PAGE 30000.00 DATA TERMINAL 11000.00
DISPLAY INC 26000.00
.. ... ... ... ...