The disadvantages of using SQL delete are (1) NOBS= is no longer
accurate, and (2) POINT= may behave unexpectedly.
If those are not issues, then the delete would be faster, with or
without an index, than recreating the data set (especially if the data
set has indexes that would need to be rebuilt).
On Aug 15, 2008, at 11:17 am, Mary wrote:
> One thing you might do is to add an index on the snap_dt to the
> dataset; if that's there then you should be able to delete the
> records in place:
> proc sql;
> delete from prod.master_date;
> where snap_dt = "&end_dt"d;
> In both the ways you are trying now you are creating new data sets
> rather than deleting records from the current data set; it would
> seem to me that a SQL delete statement would be faster than creating
> new datasets even if there isn't an index on the date.
> ----- Original Message -----
> From: SUBSCRIBE SAS-L Chandra Gadde
> To: SAS-L@LISTSERV.UGA.EDU
> Sent: Friday, August 15, 2008 12:14 PM
> Subject: Deleting SAS Data from a SAS DATASET
> Hi All
> I have several SAS datasets that are very very big. (50GB of size).
> month, the data is being appended to these datasets. I need to
> deleted the
> data which is greater than 24 months. What is the best method to do
> Please help me.
> I tried PROC SQS and DATA STEP. But these two are taking very long
> Data prod.Master_data;
> set prod.master_date;
> if snap_dt = "&end_dt"d then delete;
> proc sql;
> crete table prod.master_date from prod.master_date
> where snap_dt ne "&end_dt"d;