Previous Page | Next Page

Processing VSAM Data Sets in SAS Programs

Erasing Records from a VSAM Data Set

Erasing a record involves both input access (because the record must be read first) and output access. You can erase records from a KSDS or an RRDS. The record must be retrieved before you can erase it, and you must specify the VSAMUPDATE system option. VSAM imposes a restriction that ESDS records cannot be erased.

You must use an INFILE statement and an INPUT statement to read the record and a FILE statement and a PUT statement to erase the record from a VSAM data set. Of course, the INFILE and FILE statements must have the same fileref; that is, they must reference the same data set. You must use the ERASE= option in the INFILE statement to specify a numeric SAS variable that tells SAS whether a record is to be erased.

Previous Page | Next Page | Top of Page