Enscribe Programmer's Guide

The KEYPOSITION call sets the current position at the first record in the primary data file that
contains the value EA in the region (RG) field. Access is by the alternate-key access path RG.
Successive read calls within the read loop access all of the records in the primary data file that
contain the value EA or greater in the RG field. When two or more records contain the same value
in the RG field, those records are accessed in ascending order by the primary key. In addition to
returning a data record, each read call sets the condition code to CCE, indicating successful
completion.
The final read call in the read loop returns no data and sets the condition code to CCG, indicating
that the EOF was encountered. This illustration visually represents the results of each read call
executed within the read loop.
Alternate-
Key Field
RG
BROWN, B
KOTTER
HARTLEY
RICHARDS
SMITH
ADAMS
JONES
BROWN, A
EVANS
ROGERS
SANFORD
BOSTON, MA
NEW YORK, NY
CHICAGO, IL
MINNEAPOLIS, MN
DAYTON, OH
MIAMI, FL
DALLAS, TX
REEDLEY, CA
BUTTE, MT
BOISE, ID
LOS ANGELES, CA
EA
EA
NO
NO
NO
SO
SO
WE
WE
WE
WE
0301.00
0089.00
0433.29
0000.00
0010.00
0000.00
1234.56
0256.95
0010.00
1024.00
0301.00
1000.00
0500.00
0500.00
0500.00
0500.00
0500.00
2000.00
0300.00
0100.00
1500.00
1000.00
1
2
3
4
5
6
7
8
9
10
11
12 EOF
Example 4: Generic Subset by Primary Key
This sample TAL code shows how to perform generic positioning by the primary-key value BROWN:
! blank the key
key ':=' " ";
key[1] ':=' key FOR name^len - 1 BYTES;
key ':=' "BROWN";
compare^len := 5;
generic = 1;
CALL KEYPOSITION ( cust^filenum , key , ,
92 Key-Sequenced Files