Sample 41276: The REBUILD statement with PROC DATASETS rebuilds indexes and integrity constraints
Beginning with SAS® 9.2, the new NOINDEX option value for the system option DLDMGACTION combined with a new PROC DATASETS statement, REBUILD, gives you the flexibility to repair your data set automatically, but delay rebuilding any associated index or integrity constraint. Rebuilding an index can take time, but this option allows you to continue accessing your data set in INPUT mode until you have the time to either rebuild or remove the index.
When the DLDMGACTION=NOINDEX option is in effect and a damaged data set is encountered, the following occurs:
- An attempt is made to repair the data set without indexes or integrity constraints.
- Indexes are deleted.
- The data set is updated to reflect the disabled indexes and integrity constraints.
- The data set will only open in INPUT mode.
- A warning message is written to the SAS Log indicating that the SAS data file has been partially repaired.
When you want to continue the process to either reinstate the index or to remove it from the data set, use the DATASETS procedure's REBUILD statement. This completes the repair of the data set. After the REBUILD, the data set allows all modes of access (INPUT, UPDATE, and OUTPUT) once again.
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
If a data set contains damaged indexes or integrity constraints, the REBUILD statement can be used to repair both indexes and integrity constraints.
options ls=79 nodate nocenter DLDMGACTION=NOINDEX;
title 'REBUILD Statement';
libname xxx '\path\SAS-Data-Library';
data xxx.one;
set sashelp.shoes;
run;
/* Use the REBUILD statement to rebuild a */
/* damaged index or integrity constraint. */
proc datasets library=xxx;
rebuild one;
run;
quit;
/* You can use the code below to delete a damaged index. */
proc datasets library=xxx;
rebuild one / noindex;
run;
quit;
These sample files and code examples are provided by SAS Institute
Inc. "as is" without warranty of any kind, either express or implied, including
but not limited to the implied warranties of merchantability and fitness for a
particular purpose. Recipients acknowledge and agree that SAS Institute shall
not be liable for any damages whatsoever arising out of their use of this material.
In addition, SAS Institute will provide no support for the materials contained herein.
When indexes or integrity constraints are damaged or corrupted, the new REBUILD statement in PROC DATASETS can be used to repair them.
Date Modified: | 2011-09-13 12:58:19 |
Date Created: | 2010-10-18 10:59:19 |
Operating System and Release Information
SAS System | Base SAS | Solaris for x64 | 9.21_M1 | | 9.2 TS2M0 | |
OpenVMS on HP Integrity | 9.21_M1 | | 9.2 TS2M0 | |
Linux for x64 | 9.21_M1 | | 9.2 TS2M0 | |
Linux | 9.21_M1 | | 9.2 TS2M0 | |
HP-UX IPF | 9.21_M1 | | 9.2 TS2M0 | |
64-bit Enabled Solaris | 9.21_M1 | | 9.2 TS2M0 | |
64-bit Enabled HP-UX | 9.21_M1 | | 9.2 TS2M0 | |
64-bit Enabled AIX | 9.21_M1 | | 9.2 TS2M0 | |
Windows Vista for x64 | 9.21_M1 | | 9.2 TS2M0 | |
Windows Vista | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft Windows XP Professional | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft Windows Server 2008 for x64 | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 for x64 | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Standard Edition | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise Edition | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter Edition | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft® Windows® for x64 | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft Windows XP 64-bit Edition | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Enterprise 64-bit Edition | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft Windows Server 2003 Datacenter 64-bit Edition | 9.21_M1 | | 9.2 TS2M0 | |
Microsoft® Windows® for 64-Bit Itanium-based Systems | 9.21_M1 | | 9.2 TS2M0 | |
z/OS | 9.21_M1 | | 9.2 TS2M0 | |