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;)
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.