Enscribe Programmer's Guide

BROWN, A
BROWN, B
HARTLEY
JONES
KOTTER
ROGERS
SANFORD
SMITH
REEDLEY, CA
BOSTON, MA
CHICAGO, IL
DALLAS, TX
NEW YORK, NY
BOISE, ID
LOS ANGELES, CA
DAYTON, OH
WE
EA
NO
SO
EA
WE
WE
NO
0256.95
0301.00
0433.29
1234.56
0089.00
1024.00
0301.00
0010.00
0300.00
2000.00
0500.00
2000.00
0500.00
2000.00
2000.00
0500.00
Example 13: Relational Processing
This example illustrates relational processing in which fields from records in one file are used to
access data records in other files.
The example uses four files:
The same customer file used in Examples 1 through 12
An order file
An order detail file
An inventory file
The format of an order record is:
orderno name date total
45648320
Primary-Key
Field
Alternate-Key
Field NA
Alternate-Key
Field DT
Byte Offset:
The TAL definition of an order record is:
LITERAL name^len = 36,
date^len = 8;
STRUCT order^struct (*); ! order record
BEGIN
FIXED(2) order^orderno; ! order number
STRING order^name [0:name^len - 1]; ! name
STRING order^date [0:date^len - 1]; ! date
FIXED(2) order^total; ! total = 0 means
END; ! order not filled;
! total <> 0 means
! order filled but
! not shipped
STRUCT .order (order^struct);
The contents of the order file are:
100 Key-Sequenced Files