Previous Page | Next Page

Processing an RRDS in a SAS Job

Erasing Records from an RRDS

To erase a record from an RRDS, complete the following steps:

  1. Specify the VSAMUPDATE System Option.

  2. Use an INFILE statement and an INPUT statement to read the record and a FILE statement and a PUT statement to erase the record. The INFILE statement and FILE statement must have the same fileref; they must reference the same data set.

  3. Specify the record that you want to erase with the RRN= option and the ERASE= option in the INFILE statement. The ERASE= option specifies a numeric SAS variable that tells SAS whether a record is to be erased.

See SAS Options for an RRDS for a list of the options that you can use when you erase records. The following list explains which values you can set for the ERASE= option as well as what the values specify:

In the following example, the variable RRNVAR in the SAS data set ERASEREC contains the RRNs of the records that you want to erase. Notice that the PUT statement erases the record rather than updating it, because the ERASE= variable, ERASEVAR, is set to a value of 1.

data seven;
   set rrnumbrs;
   erasevar=1;
   infile myrrds vsam rrn=rrnvar erase=erasevar;
   file myrrds vsam;
   input;
   put _infile_;
run;

Previous Page | Next Page | Top of Page