820-FILTER-UPDRNG-<Index>

Name

820-FILTER-UPDRNG-<Index>

Description

This API extends the functionality of the 820-UPDATERNG-<Index> API by providing filter capabilities.

You can use 820-FILTER-UPDRNG--<Index> to restrict the records beyond the range keys set for 820-UPDATERNG-<Index> . A return field indicates whether any rows were updated. Also, an error code is returned.

Location

This API is generated by the compiler.

Input Values

The same working storage value can be used as the update value for more than one field. This is equivalent to using a MOVE or ADD function with the same value on multiple fields.

Field Description
<Index> You must specify the database index name that you want to create a record in.
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-UPDATE-CMD You must specify the update string that will be used in updating the records.

Return Values

Field Description
WS-DB-UPDATE-COUNT The working storage field that returns 1 or 0 depending on whether any records were updated.

Using the API in a Program

Programming Example

.. create WS-DB-UPDATE-CMD text ...

MOVE CURRENT-COMPANY     TO DB-COMPANY.
MOVE CURRENT-EMPLOYEE     TO DB-EMPLOYEE.
MOVE TRDSET1-EMPLOYEE     TO WS-DB-BEG-RNG.

MOVE "(TRD-TIME-SEQ >= ?) AND (TRD-TIME-SEQ <= ?)"
                          TO FILTER-STRING.

... set parameter values ...
PERFORM 890-CREATE-FILTER.

PERFORM 820-FILTER-UPDRNG-TRDSET1.