01-09-2012 01:57 AM
deleteing the obs
Hi I am having 5 crores obs obs with 80 variables i want to delete the obs.I have tryed
delete * from but it was taking more time.
I have tryed
it works but is there any alternate to delete the obs from the table at once
as truncate table.
Is there any thing like truncate table in sas
01-09-2012 04:55 AM
No Actually is there any thing to delete all the observations in a table .in a tabale i am having 5 crores of data
so i want to delete them at once how can i do .
01-09-2012 10:09 AM
So, you want to delete all 50 million rows from the dataset, leaving the same dataset containing no rows?
create table foo like foo;
01-09-2012 10:28 PM
Your data step code looks o.k. to me. You could also code it like:
The SQL delete * takes more time because it's actually not truncating the table but only marking rows for deletion - so it has to process all rows AND the table keeps its size.
01-10-2012 12:21 AM
As Patrick said. It will waste you lots of time.
But there is another statement to delete all obs in a table.
data class; set sashelp.class; label sex='gender'; format weight dollar12.; run; proc sql; delete * from class; quit;