I have a data set in SAS for which I have created index on some columns.
I would like to truncate this data and would still like to retain the index on the tables. In other words , I want to delete the data from this data set , but the table structure and the indexes will remain the same.
I tried that option also. But the indexes are deleted.
The reason why I'm taking this approach it I have a very large SAS data set that has 3 million rows and I need to truncate this data set and reload it quite often,
It is taking lot of time to create index on this large dataset.
Based on an old V8 data warehouse I took over several years ago (so results may differ in V9) the weekly data refresh was taking 15 hours with indexes in place. It dropped to 15 min by dropping the index. loading data and rebuilding the index. The index will be rebuilt either way. The difference is that you (at least in V8) were rebuilding the index after each observation rather than all at once.
data (index = ());
set (obs = 0);
will truncate the data and rebuild the empty index.