LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2001, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Sun, 4 Mar 2001 12:03:48 +0100
Reply-To:     Lex Jansen <l.jansen@LEX-JANSEN.DEMON.NL>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Lex Jansen <l.jansen@LEX-JANSEN.DEMON.NL>
Subject:      Re: Delete files from SAS

Try this:

data _null_; length fname $200; fname="tempfile"; rc=filename(fname,"c:\temp\deleteme.xls"); if rc = 0 and fexist(fname) then rc=fdelete(fname); rc=filename(fname); run;

or in a macro:

%let rc=%sysfunc(filename(fname,c:\temp\deleteme.xls)); %if &rc = 0 and %sysfunc(fexist(&fname)) %then %let rc = %sysfunc(fdelete(&fname)); %else %put %sysfunc(sysmsg()); %let rc=%sysfunc(filename(fname,''));

Lex Jansen

<> wrote in message news:97sbon$gnt$ > hi, > > Is it possible for me to delete a file on Windows from my SAS session. I use > Proc DBload to create an excel file from a SAS file. However, if the original > file exists, I have to manually remove it. > > Thanks. > > brad > > > ----- Posted via NewsOne.Net: Free (anonymous) Usenet News via the eb ----- > -- Free reading and anonymous posting to 60,000+ groups > NewsOne.Net prohibits users from posting spam. If this or other posts > made through NewsOne.Net violate posting guidelines, email

Back to: Top of message | Previous page | Main SAS-L page