850-FIND-MIDRNG-<Index>
Name
850-FIND-MIDRNG-<Index>
Description
When you need to process a range of data, starting at a given point in the range, use 850-FIND-MIDRNG-<Index> .
Using the API in a Program
You can use this routine by itself or in conjunction with 850-FIND-BEGRNG-<Index> and 860-FIND-NXTRNG-<Index> .
The database routines perform an equal condition on all DB
fields that have an assigned value--that is,
all columns up to, and including, the field moved to WS-DB-BEG-RNG
.
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>.
|
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. |
Return Values
Field | Description |
---|---|
<FileName>-SW | The Find routines set the <FileName>-SW switch to indicate the outcome of the read. |
<FileName>-FOUND |
Each routine sets the logical value <FileName>-NOTFOUND or <FileName>-FOUND based on the outcome of the read process. |
Programming Examples
This example uses the 850-FIND-BEGRNG-NAMSET1 routine to locate records with the last name of Smith, then uses the 850-FIND-MIDRNG-NAMSET1 routine to find records with the last name of Smith and first name of Pam.
|
The next example uses the 850-FIND-MIDRNG
routine by itself to go directly to record with WS-DB-BEG-RNG
, and process from that record
forward.
|
This final example sets the initial range value on ALT-TYPE
field using the 850-FIND-BEGRNG
routine, and then sets the mid-range values from the initial 850-FIND-BEGRNG
results. Processing with
the 850-FIND-MIDRNG
routine starts at the next
INVOICE value.
|