830-DELETERNG-<Index>

Name

830-DELETERNG-<Index>

Description

830-DELETERNG-<Index> deletes all records in a range. When this routine deletes a range of database records, it also deletes all index entries associated with that range of records.

Using the API in a Program

You must populate the delimiting DB fields and WS-DB-BEG-RNG before using 830-DELETERNG-<Index> . In recoverable database environments, 830-DELETERNG-<Index> cannot span more than one transaction state. Deleting a very large range of records in a single block creates a very large journal, or transaction, that might exceed a limit. If a range does not realistically fit in a single transaction, you must use a modify/delete loop, with specific attention paid to controlling the size of the logical transactions.

Input Values

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)

You must populate the index key fields used to locate the record before using this call.

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.

Programming Example

The following example shows the 830-DELETERNG-<Index> routine used to drop a range of records from a file.

*       Delete all sales rep entries from a  
*       particular company in the SALESREP file.
        PERFORM 910-AUDIT-BEGIN.

        MOVE WS-COMPANY         TO DB-COMPANY.
        MOVE SAWSET1-COMPANY    TO WS-DB-BEG-RNG.
        PERFORM 830-DELETERNG-SAWSET1.

        PERFORM 920-AUDIT-END.