BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
W1ndwaker
Obsidian | Level 7

Im checking my datasets and a way to shrink them to retrieve some space, and i saw that after deleting millions of rows from some datasets using proc sql; delete; the datasets keeps the size on the server file, and i saw in the dictionary table that there is column named delrows where you have all the data deleted "logically" from the dataset, but not from the file:

pdiaz_0-1665397536367.png

this is a sample of some tables with a lot of rows that are deleted from the dataset but keep, i supose logically in there, like a windows delete i supose there would be a "defragmentation" of the table to phisically delete this registers, but i didn't found anything on the kb to proceed with it, is there a way to permanently remove this rows and regain the space at administration level?

Or am i forced to do a DATA / SET step to recreate the table?

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
LinusH
Tourmaline | Level 20

For SAS datasets, you basically have two options:

- as you suggested, recreate the dataset

- have the dataset compressed, and specify REUSE=YES. This will compact the dataset over time, but it will be fragmented as time goes by.

Data never sleeps

View solution in original post

4 REPLIES 4
LinusH
Tourmaline | Level 20

For SAS datasets, you basically have two options:

- as you suggested, recreate the dataset

- have the dataset compressed, and specify REUSE=YES. This will compact the dataset over time, but it will be fragmented as time goes by.

Data never sleeps
W1ndwaker
Obsidian | Level 7
I've been searching for other options but in the end i think we'll have to stick to the data step to recreate the table, and try to avoid deletes with proc sql in the bigger tables.

Thanks for the reply!
Ksharp
Super User
/*
Do you have SAS/IML?
If you have, you could try PURGE operator

Here is an example:
*/


libname x v9 'C:\temp\a';
data x.have;
 set sashelp.heart;
run;

proc sql;
delete from x.have where status='Dead';
quit;



proc iml;
edit x.have;
purge;
close;
quit;
W1ndwaker
Obsidian | Level 7
I don't have IML, but in the end will be the same as a data step, because purge invalidates the index of the table and you have to recreate it, and this will lead to a pruge and then a index creation and will be the same probably speaking of mantainance times.

Think we will go for the data step, if it's run periodicaly it'll be pretty fast after the first celaning.

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 631 views
  • 3 likes
  • 3 in conversation