Enscribe Programmer's Guide

Exact mode selects only those records whose access path key value matches the supplied key value
exactly. Figure 8 (page 30) shows examples of subsets returned by each positioning mode.
The positioning mode, comparison length, and current key value supplied in a KEYPOSITION
procedure call together specify a subset of records and the first record in that subset to be accessed.
The subset of records in the current access path can consist of all, part, or none of the records in
a file.
Figure 8 Approximate, Generic, and Exact Subsets
Find "JONES"
Generic
HUNT, H.L.
IRWIN, F.J.
JONES, A.B.
JONES, K.A.
JONES, M.P.
JONES, Z.Z.
JORDAN, W.R.
KANE, C.T.
KING, M.L.
LACEY, G.T.
LANG, M.N.
MEYER, D.J.
Start
Exact
HUNT, H.L.
IRWIN, F.J.
JONES, A.B.
JONES, K.A.
JONES, M.P.
JONES, Z.Z.
JORDAN, W.R.
KANE, C.T.
KING, M.L.
LACEY, G.T.
LANG, M.N.
MEYER, D.J.
Find "JONES, K.A."
Start
Approximate
HUNT, H.L.
IRWIN, F.J.
JONES, A.B.
JONES, K.A.
JONES, M.P.
JONES, Z.Z.
JORDAN, W.R.
KANE, C.T.
KING, M.L.
LACEY, G.T.
LANG, M.N.
MEYER, D.J.
Find "JONES"
Start
Approximate
Subset
Generic
Subset
Reading the file
sequentially
returns 10 records,
then an EOF.
Reading the file
sequentially
returns 1
record,
then an EOF.
Reading the file
sequentially
returns 4
records,
then
an EOF.
Last
Record
in File
Exact
Subset
The positioning mode and comparison length (as well as the current key specifier and current key
value) are set explicitly by the FILE_SETKEY_ and KEYPOSITION procedures and implicitly by the
FILE_OPEN_, FILE_SETPOSITION_ and POSITION procedures. The Enscribe software supports
three positioning modes:
approximate
generic
exact
Approximate Positioning
Approximate positioning means the first record accessed is the one whose key field, as indicated
by the current key specifier, contains a value equal to or greater than the current key value for the
number of bytes specified by the comparison length. After approximate positioning, sequential
FILE_READ64_/READ operations to the file return ascending records in the current access path
until the last record in the file is read; an EOF indication is then returned. When a file is opened,
the positioning mode is set to approximate and the comparison length is set to 0.
Generic Positioning
Generic positioning means the first record accessed is the one whose key field, as designated by
the current key specifier, contains a value equal to the current key value for the number of bytes
specified by the comparison length. After generic positioning, sequential FILE_READ64_/READ
operations to the file return ascending records whose key matches the current key value (for the
comparison length). When the current key no longer matches, an EOF indication is returned.
30 Positioning Within Structured Files