When I use PROC SQL; DELETE FROM TABLE; i see that sas file is constantly increasing. How can I enforce (with some option perhaps) to delete recordes permanently and free the disk space?
I am not sure if this is relevant: if I use system options compress=yes, and then after I delete some records, the file size remains the same, unless you invoke another system option: reuse=yes.
So it would look like this:
options compress=yes;
options reuse=yes;
What it does is to reuse those vacant slots from deleted records instead of appending to the end.
BTW, these two options are also data set options as well.
Regards,
Haikuo
I don't understand what you mean.
If you want delete a table ,then use DROP TABLE
If you want keep the constructure of a table ,then use CREAT TABLE xx LIKE xx, then drop the original table.
Ksharp
Example of your query and what you are trying to achieve? Please elaborate
I've got table T1.
When I delete all record from it (Proc sql; Delete from T1;) the table size doesn't decrease. Moreover, when I put some records in this table I see that record number shows as If there were some "invisible records" inside. System seems to keep deleted record which take disk space and when iserting new records the table size is contantly growing..
when you delete all records from table , try seeing contents of dataset and see if you can see that or not.
Then you tried the way HaiKuo proposed?
You seem to have figured out how SAS works when you delete records without recreating the dataset. If it is a concern to you then recreate the dataset. (data old; set old; run;)
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.