The DATASETS Procedure |
Default: | Rebuild indexes and integrity constraints |
Restriction: | Data sets created in Version 7 or later |
REBUILD SAS-file </ ALTER=password GENNUM=n MEMTYPE=mtype NOINDEX>; |
Required Argument |
specifies a SAS data file that contains the disabled indexes and integrity constraints. You can also use a numbered range list or colon list. For more information, see Data Set Lists.
Options |
provides the alter password for any alter-protected SAS files that are named in the REBUILD statement. You can use the option either in parentheses after the name of each SAS file or after a forward slash.
restricts processing for generation data sets. You can use the option either in parentheses after the name of each SAS file or after a forward slash. Valid value is integer, which is a number that references a specific version from a generation group. Specifying a positive number is an absolute reference to a specific generation number that is appended to a data set's name; that is, gennum=2 specifies MYDATA#002. Specifying a negative number is a relative reference to a historical version in relation to the base version, from the youngest to the oldest; that is, gennum=-1 refers to the youngest historical version. Specifying 0, which is the default, refers to the base version.
See also: | "Understanding Generation Data Sets" in SAS Language Reference: Concepts |
restricts processing to one member type.
Aliases: | MT=, MTYPE= |
Default: | If you do not specify the MEMTYPE= option in the PROC DATASETS statement or in the REBUILD statement, the default is MEMTYPE=ALL. |
specifies to delete the disabled indexes and integrity constraints.
Restriction: | The NOINDEX option cannot be used for data files that contain one or more referential integrity constraints. |
Details |
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
deletes the index file
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.
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.
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.