Previous Topic: #ENDPAG ExampleNext Topic: @ERASE Syntax


@ERASE—disconnects or erases records

The @ERASE statement performs the following functions:

Erasure is a two-step process that first cancels the existing membership of the specified record in specific set occurrences and then releases for reuse the space occupied by the named record and its db-key. Erased records are unavailable for further processing by any DML statement.

Before using the @ERASE statement, you must ready all the areas affected, either implicitly or explicitly, in one of the three update usage modes (see Dictionary Usage Mode).

Currency

Before execution of the @ERASE statement, the following currency-related conditions must be satisfied:

Following successful execution of an @ERASE statement, currency is nullified for all record types both explicitly and implicitly involved in the erase and for all sets in which erased records participate. Run unit and area currency remain unchanged.

Note: Native VSAM users—When the @ERASE statement is used against a native VSAM area, the area currency changes and reflects the next record in the native VSAM area.

An attempt to retrieve erased records results in an error condition. However, if the erased record was reached by walking the set occurrence of the erased record, the prior of set is maintained for the erased record, whether or not prior pointers were defined for that set. (The next of set is also maintained, as usual). Also, CA IDMS/DB maintains the next, prior, and owner pointers for the last erased record occurrence that participates as a member in any other set occurrence not the object of the @ERASE. In this case, you can retrieve the next or prior records in the area, or the next, prior, or owner records in the set in which the erased record participated.