Previous Topic: @ERASE SyntaxNext Topic: @ERASE Status Codes


@ERASE Parameters

REC/PERMANENT/SELECTIVE/ALL,REC=record-name

Erases a record from the database.

REC

Erases the specified record if it is not an owner of any member records. An error condition results if the named record is the owner of any nonempty set occurrences.

Note: Native VSAM users—@ERASE REC,REC=record-name is the only form of the @ERASE statement valid for records in a native VSAM KSDS or RRDS; no form of the @ERASE statement is allowed for a native VSAM entry-sequenced data set (ESDS).

PERMANENT

Erases the specified record and all mandatory member record occurrences owned by that record. Optional member records are disconnected. If any of the erased mandatory members are themselves the owners of any set occurrences, the @ERASE statement is executed on such records as if they were directly the named record of an @ERASE PERMANENT statement (that is, all mandatory members of such sets are also erased). This process continues until all (direct and indirect) members have been processed.

Note: The statement ERASE/PERMANENT/SELECTIVE/ALL cannot be used where there exists a cyclical relationship between two or more of the records that are to be erased. The following describes a cyclical set relationship:

REC-A owns REC-B in the A-B set
REC-B owns REC-C in the B-C set
REC-C owns REC-B in the C-B set

(cyclical relationship between REC-B and REC-C)

Junction records should be used to define the needed relationships.

SELECTIVE

Erases that record and all mandatory member record occurrences owned by the specified record. Optional member records are erased if they do not currently participate as members in other set occurrences. All erased records that are themselves the owners of any set occurrences are treated as if they were the object of an @ERASE SELECTIVE statement.

ALL

Erases the specified record and all mandatory member record occurrences owned by the specified record. All erased records that are themselves the owners of any set occurrences are treated as if they were the specified record of an @ERASE ALL statement.

REC=record-name

A record included in the subschema. The current of record-name must be current of run unit.