Date: Wed, 7 Jul 2010 16:06:26 -0400
Reply-To: Arthur Tabachneck <art297@NETSCAPE.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Arthur Tabachneck <art297@NETSCAPE.NET>
Subject: Re: Proc Delete Lives On In SAS Institure Code
Paul,
But you can by combining a small bit of sql code and, between running the
code and proc delete with a macro variable, it is still substantially
faster than proc datasets. E.g.:
/* Create 100 files for test purposes */
%macro makefile;
%do i=1 %to 100;
data deleteme&i.;
set sashelp.class;
run;
%end;
%mend makefile;
%makefile
/*use proc datasets to delete the files */
proc datasets;
delete deleteme:;
quit;
NOTE: PROCEDURE DATASETS used (Total process time):
real time 0.25 seconds
cpu time 0.25 seconds
%makefile
/*use proc sql and proc delete to delete the files */
proc sql noprint;
select memname
into :filelist separated by ' '
from dictionary.tables
where libname="WORK" and
substr(memname,1,8)="DELETEME";
quit;
NOTE: PROCEDURE SQL used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
proc delete data=&filelist.;
run;
real time 0.15 seconds
cpu time 0.15 seconds
Art
--------
On Wed, 7 Jul 2010 12:27:10 -0700, Choate, Paul@DDS
<Paul.Choate@DDS.CA.GOV> wrote:
>Missed this last week. Please excuse the late post.
>
>Proc delete doesn't allow wildcard colons! So if you have several
datasets with a common suffix you can't sweep them all out in one.
>
>data help1 help2 help3 help4 help5 help6 help7 help8;
> set sashelp.class;
>run;
>
>/*isn't allowed*/
>proc delete data=help:;
>run;
>
>/* minimal form? */
>proc delete data=help1 help2 help3 help4 help5 help6 help7 help8;
>run;
>
>/* like magic */
>proc datasets; delete help:;
>quit;
>
>
>Paul Choate
>DDS Data Extraction
>(916) 654-2160
>-----Original Message-----
>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
Fehd, Ronald J. (CDC/OSELS/NCPHI)
>Sent: Tuesday, June 29, 2010 10:16 AM
>To: SAS-L@LISTSERV.UGA.EDU
>Subject: Re: Proc Delete Lives On In SAS Institure Code
>
>http://www.sascommunity.org/wiki/PROC_Delete
>
>note which is faster:
>
>* proc datasets delete
>* sql drop table
>* proc delete <---<<<
>
>Ron Fehd the quicker is better maven
>
>> -----Original Message-----
>> From: Nat Wooding
>> Subject: Proc Delete lives on in SAS Institute Code
>>
>>
>> Although Proc Delete long ago disappeared from SAS documentation, it
>is
>> occasionally referenced in threads on this list. For those who have
>not
>> seen
>> it, the syntax is
>>
>> Proc Delete data = one;
>> Run;
>>
|