860-FIND-NXTRNG-<Index>

Name

860-FIND-NXTRNG-<Index>

Description

When you need to process a range of data without interruption, use 860-FIND-NXTRNG-<Index> .

Using the API in a Program

You must precede 860-FIND-NXTRNG-<Index> with 850-FIND-BEGRNG-<Index> , 850-FIND-SUBRNG-<Index> , 850-FIND-MIDRNG-<Index> , or 850-FIND-MIDSUBRNG-<Index> .

Input Values

Field Description

<Index>

You must specify the index in the FIND statement.

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

Comparing this example to the example that uses 850-FIND-BEGRNG-<Index> (850-FIND-BEGRNG-<Index>) and 860-FIND-NEXT-<Index> (860-FIND-NEXT-<Index>) shows two major usage differences:

  • You do not need to fill the extra Index key fields with blanks. Instead, the WS-DB-BEG-RNG variable identifies the last key field to be used as a delimiter. This restricts the routine to return only those records that have values matching those specified for the key fields.

  • You no longer need to use the extra OR checks of the DB fields in the UNTIL clause. The interface performs the checks.

***     This call processes a range of records.
        MOVE WS-COMPANY              TO DB-COMPANY.
        MOVE WS-ACCOUNT              TO DB-ACCOUNT.
        MOVE WS-SUB-ACCOUNT          TO DB-SUB-ACCOUNT.
        MOVE GLMSET1-SUB-ACCOUNT     TO WS-DB-BEG-RNG.
        PERFORM 850-FIND-BEGRNG-GLMSET1.
        PERFORM
            UNTIL (GLMASTER-NOTFOUND)
            PERFORM 999-PROCESS-GLM
            PERFORM 860-FIND-NXTRNG-GLMSET1
        END-PERFORM.