f



Re: Deleting SAS Data from a SAS DATASET #3

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).


--
Jack Hamilton
jfh@alumni.stanford.org



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;
> quit;
> run;
>
> 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.
>
> -Mary
>  ----- 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).
> Every
>  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
> this?
>  Please help me.
>
>  I tried PROC SQS and DATA STEP. But these two are taking very long
> time.
>
>  Data prod.Master_data;
>    set prod.master_date;
>    if snap_dt = "&end_dt"d then delete;
>  run;
>
>  proc sql;
>  crete table prod.master_date from prod.master_date
>  where snap_dt ne "&end_dt"d;
>  quit;
0
jfh (1342)
8/15/2008 7:05:50 PM
comp.soft-sys.sas 142827 articles. 4 followers. Post Follow

0 Replies
1129 Views

Similar Articles

[PageSpeed] 28

Reply: