When the DLDMGACTION=NOINDEX
data set or system option is specified and SAS encounters a damaged
data file, SAS does the following:
-
repairs the data file without indexes
and integrity constraints
-
-
updates the data file to reflect
the disabled indexes and integrity constraints
-
limits the data file to be opened
only in INPUT mode
-
writes the following warning to
the SAS log:
WARNING: SAS data file MYLIB.MYFILE.DATA was damaged and
has been partially repaired. To complete the repair,
execute the DATASETS procedure REBUILD statement.
The REBUILD statement completes the repair of a
damaged SAS data file by rebuilding or deleting all of the data file's
disabled indexes and integrity constraints. The REBUILD statement
establishes and uses member-level locking in order to process the
new index file and to restore the indexes and integrity constraints.
To rebuild the index
file and restore the indexes and integrity constraints, use the following
code:
proc datasets library=mylib
rebuild myfile
/alter=password
gennum=n
memtype=mytype;
To delete the disabled
indexes and integrity constraints, use the following code:
proc datasets library=mylib
rebuild myfile /noindex;
After you execute the
REBUILD statement, the data file is no longer restricted to INPUT
mode.
The REBUILD statement
default is to rebuild the indexes and integrity constraints and the
index file.
If a data file contains
one or more referential integrity constraints and you use the NOINDEX
option with the REBUILD statement, the following error message is
written to the SAS log:
Error: Unable to rebuild data file MYLIB.MYFILE.DATA using the
NOINDEX option because the data file contains referential
constraints. Resubmit the REBUILD statement without the
NOINDEX option to restore the data file.