850-MODFILTER-BEGRNG-<Index>

Name

850-MODFILTER-BEGRNG-<Index>

Description

Makes the database call and locks the record.

850-MODFILTER-BEGRNG-<Index> reads and locks the first database record in the range based on the values you set in the record retrieval variables (DB fields) corresponding to the index key fields and the filter created earlier in the program.

Using the API in a Program

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 the 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) Fill in only the DB fields that define the appropriate range; leave empty those DB fields that do not define the range.

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

This example is from PR33.


MOVE WS-FALSE TO  PRTRD-LP-MESSAGE-SW.

PERFORM
     VARYING PRTRD-LP-I1 FROM 1 BY 1
     UNTIL (PRTRD-LP-I1 > PRTRD-LP-DEL-MAX)
     OR    (PRTRD-LP-DEL-PROC-LEV (PRTRD-LP-I1) = SPACES)
     OR    (PRTRD-LP-MESSAGE)
          MOVE SPACES                TO DB-CYCLE-PROCESS
          MOVE SPACES                TO DB-PROC-GROUP
          MOVE PRTRD-LP-DEL-PROC-LEV (PRTRD-LP-I1)
                                      TO DB-PROCESS-LEVEL
          MOVE SPACES                TO DB-BANK-CODE
          MOVE SPACES                    TO FILTER-STRING
          MOVE "(PMN-LP140-RUN-FLG = ?)" TO FILTER-STRING
          PERFORM 890-CREATE-FILTER
          MOVE "*"                 TO ALPHANUM-FILTER-VALUE
          PERFORM 890-SET-ALPHANUM-FILTER-VALUE
          MOVE PMNSET1-BANK-CODE   TO WS-DB-BEG-RNG
          PERFORM 850-MODFILTER-BEGRNG-PMNSET1
          IF (PRMONITOR-FOUND)
              MOVE "4"         TO PMN-LP140-RUN-FLG
              PERFORM 820-STORE-PRMONITOR
              MOVE WS-TRUE     TO PRTRD-LP-MESSAGE-SW
              MOVE "PRTRD"     TO CRT-ERROR-CAT
              MOVE 257         TO CRT-MSG-NBR
              PERFORM 790-GET-MSG
              MOVE CRT-MESSAGE TO PRTRD-LP-MSG
          END-IF
END-PERFORM.