850-FILTER-MIDSUB-<Index>

Name

850-FILTER-MIDSUB-<Index>

Description

When you need to process a range of data, starting at a given point in the range, use 850-FILTER-MIDSUB-<Index> .

Using the API in a Program

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.

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.

Filter value parameter Set this parameter using a method described in Setting the Filter Parameter Value, and create the filter using the routine described in 890-CREATE-FILTER.

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.

Programming Example

The following example uses 850-FILTER-SUBRNG-<Index> and then 850-FILTER-MIDSUB-<Index> to reposition.

MOVE "(ARH-ORIG-AMT > ?)"        TO FILTER-STRING.
PERFORM 890-CREATE-FILTER.
MOVE 45                          TO  SIGNED2-FILTER-VALUE.
PERFORM 890-SET-SIGNED-FILTER-VALUE2.
IF (SMIDF1-FC = "I")
  MOVE SMIDF1-SV-ARH-TRANS-TYPE  TO DB-ALT-TYPE
  MOVE SMIDF1-SV-ARH-COMPANY     TO DB-COMPANY
  MOVE WS-SUB-BEG                TO DB-INVOICE
  MOVE WS-SUB-END                TO DBRNG-INVOICE
  MOVE ARHSET6-INVOICE           TO WS-DB-SUB-RNG
  PERFORM 850-FILTER-SUBRNG-ARHSET6
ELSE
IF (SMIDF1-FC = "+")
  MOVE SMIDF1-PT-ARH-TRANS-TYPE  TO DB-ALT-TYPE
  MOVE SMIDF1-PT-ARH-COMPANY     TO DB-COMPANY
  MOVE SMIDF1-PT-ARH-INVOICE     TO DB-INVOICE
  MOVE WS-SUB-BEG                TO DBSRNG-INVOICE
  MOVE WS-SUB-END                TO DBRNG-INVOICE
  MOVE ARHSET6-INVOICE           TO WS-DB-SUB-RNG
  PERFORM 850-FILTER-MIDSUB-ARHSET6