Enscribe Programmer's Guide

Primary-Key
Field
BROWN, B BOSTON, MA EA 0301.00 1000.00
KOTTER NEW YORK, NY EA 0089.00 0500.00
HARTLEY CHICAGO, IL NO 0433.29 0500.00
RICHARDS MINNEAPOLIS, MN NO 0000.00 0500.00
SMITH DAYTON, OH NO 0010.00 0500.00
ADAMS MIAMI, FL SO 0000.00 0500.00
JONES DALLAS, TX SO 1234.56 2000.00
BROWN, A REEDLEY, CA WE 0256.95 0300.00
EVANS
BUTTE, MT
WE 0010.00 0100.00
ROGERS BOISE, ID WE 1024.00 1500.00
SANFORD LOS ANGELES, CA WE 0301.00 1000.00
1
2
3
4
5
6
7
8
9
10
11
12 EOF
Example 3: Approximate Subset by Alternate Key
This sample TAL code shows how to perform approximate positioning by the alternatekey value
EA within the RG access path:
! blank the key
key ':=' " ";
key[1] ':=' key FOR name^len - 1 BYTES;
! position to the first record that contains EA in the
! region field
key ':=' "EA";
CALL KEYPOSITION ( cust^filenum, key, "RG" );
cust^eof := 0;
WHILE NOT cust^eof DO
BEGIN ! read loop
CALL READ (cust^filenum, cust^rec, $LEN(cust^rec) );
IF > THEN cust^eof := 1
ELSE
IF < THEN ... ! error
ELSE
BEGIN ! process the record
...
END;
END; ! read loop
Accessing Key-Sequenced Files 91