To Search By Key A Direct Access Data File - IBM 5110 User Manual

Apl
Table of Contents

Advertisement

To Search by Key a Direct Access Data File
When doing update operations to a direct access data file, you can
search the file for a specific record by first assigning a key value to
the OAT shared variable and then assigning the following vector to the
CTL shared variable:
CTL
+-
2
I
starting record numbe\f records
Unlike reading from and writing to
Specifies a search
by key.
a direct access data file, the third
element must be specified for
a search by key.
When a search by key is specified, the key value currently assigned to
OAT is checked against the equivalent number of beginning bytes in
the specified sectors. The specified sectors include the sector that
contains the starting record number through the sector that contains
the last record specified (determined by the number of records
specified). For example:
Sector Boundaries
The first 4 bytes in three sectors
are compared with the key value.
When you are creating a file for search by key operations, the file
should meet the following requirements:
• The records are sorted in ascending sequence.
• The records do not span sector boundaries.
However, there can be
multiple records in
a
sector.
• A record that is greater than any key value that might be specified
should start on the sector boundary following the last valid data
record.
I nput/Output Control
131

Advertisement

Table of Contents
loading

Table of Contents