LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (June 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 23 Jun 2004 16:53:44 -0400
Reply-To:     Jim Groeneveld <jim.groeneveld@VITATRON.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jim Groeneveld <jim.groeneveld@VITATRON.COM>
Subject:      Re: How to Erase old file and write on it

On Wed, 23 Jun 2004 13:23:32 -0700, kumar <subramanyam_22@YAHOO.COM> wrote:

>I have Program running that is supposed to erase all the old data and >write new data on it somehow it is not doing it does anybody has an >Idea, I do not Know I am be wrong but I looking code like this > >CALL SYSTEM('ERASE ' || "&PGMDRIVE" || '\INVEST\PRINTOUT\' || >TRIM(REPORT) || '.PRT'); > DELETE; > >i am not sure Please help me >Thank you in advance.

Hi Kumar,

Apparently you want to delete any file in the Windows system (if it is Windows you are working on), not just a SAS dataset. In that case you could issue a DOS command via the CALL SYSTEM statement, the X command, or the % SYSEXEC macro statement, but the DOS command for deleting is DEL, just the three letters DEL, nothing more, not ERASE.

However, if you write some new ascii file with a FILE statement in your data step, I think it is automagically overwritten already, unless you would specify some append option OLD. So you don't really need to delete a file physically beforehand.

If you want to delete an existing dataset you could: PROC DATASETS; DELETE <<Lib_name.dataset_name>>; * default lib_name = work; RUN;

Regards - Jim (as already said, from home via web, late in the evening).


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