Skip to main content

Posts

Showing posts from November, 2016

SAS code to remove corrupt table in SPDS

There are cases where the SPDS index table get corrupted. Because of index table corruption batch jobs gets fail. To fix this issue we can just drop the corrupt index from table. Below code help us to identify the index of corrupted SPDS table and delete the index. When you re-run the batch job, index will automatically gets re-created. There is also PROC procedure which will help to delete the index.  /* simple query to check whether table is corrupt */ proc sql; select count(*) as cnt from desktop.SALES_YEARLY; quit; /* identify index names */ proc sql; describe table desktop.SALES_YEARLY; quit; /* drop corrupt index */ proc sql; drop index keys from desktop.SALES_YEARLY; quit; /* simple query to check whether table is corrupt - should now run successfully*/ proc sql; select count(*) as cnt from desktop.SALES_YEARLY; quit; I n above code desktop is the library name and SALES_YEARLY is the table name. If you not familiar with SAS code just change the deskto