850-KFIND-SUBRNG-<Index>

Name

850-KFIND-SUBRNG-<Index>

Description

850-KFIND-SUBRNG-<Index> performs similarly to 850-KFIND-BEGRNG-<Index> , but it allows for more precision in defining the range, because it lets you specify beginning and ending values on the last key field defining the range. The routine inquires on the database records in a range. It accesses and returns only the key fields from an index. It does not access or return whole database records from a file. Otherwise, it works as the normal range find calls work.

The database routines perform an equal condition on all DB Index fields up to the subrange field designated in the WS-DB-SUB-RNG . It performs a "where greater-than and less-than" condition on this index field.

Using the API in a Program

850-KFIND-SUBRNG-<Index> must be paired with a 860-KFIND-NXTRNG-<Index> .

You must populate the delimiting DB fields and WS-DB-BEG-RNG before using 850-KFIND-SUBRNG-<Index> .

You must populate the delimiting DB fields and WS-DB-SUB-RNG before using 850-KFIND-SUBRNG-<Index> .

Input Values

Field Description

<Index>

You must specify the index in the FIND statement.

Record retrieval variables (also known as DB fields) Define the beginning and ending values of the last key by moving the appropriate values to the record retrieval fields named DB- <KeyFieldName> and DBRNG- <KeyFieldName>.
WS-DB-BEG-RNG

Move the symbolic constant <IndexName>-<IndexFieldName> to the field WS-DB-BEG-RNG in order to tell the interface which key is the last significant one defining the range. The symbolic constant is numerically equivalent to the position of the named field in the Index.

WS-DB-SUB-RNG

Move the symbolic constant <IndexName>-<IndexFieldName> to the field WS-DB-SUB-RNG in order to tell the interface which key is the last significant one defining the range. The symbolic constant is numerically equivalent to the position of the named field in the index.

Return Values

Field Description
<FileName>-SW The Find routines set the <FileName>-SW switch to indicate the outcome of the read.

<FileName>-NOTFOUND

<FileName>-FOUND

Each routine sets the logical value <FileName>-NOTFOUND or <FileName>-FOUND based on the outcome of the read process.