Desktop productivity for business analysts and programmers

Deleting .sas7bdat via BAT file

Reply
Regular Contributor
Posts: 220

Deleting .sas7bdat via BAT file

Hello Friends, I need some help plz....

I am using SAS 9.1 and have set up one automatic .bat file which is cleaning all sas datasets with .sas7bdat extension every wk. I am using below command...what is happening is sas datasets get deleted but after some process run on wkend...even year old sas datasets get back here....and i have no idea how we are getting back those datasets automatically..... even we don't have any back up process in place which would put all those old sas datasets back....this is "sasuser" library path...where user's default sas datasets get stored....

any suggestion...???

c:

cd \

DEL /Q C:\xyz_directory_path\9.1\*.sas7bdat

FOR /D %%i in ("C:\xyz_directory_path\9.1\*.sas7bdat") do rd /Q "%%i"

exit

Grand Advisor
Posts: 10,210

Re: Deleting .sas7bdat via BAT file

SASUSER does not hold "default" datasets, it holds things related to the user. If some of the files are not there when SAS starts it will make them, such as SASUSER.Profile, which has things like the SAS window color and location information, using default information stored in SASHelp.

If you are putting work related files in that library I would suggest using another permanent library or two and cleaning them. Or since those sets get recreated when SAS starts just ignore that they reappear.

Regular Contributor
Posts: 220

Re: Deleting .sas7bdat via BAT file

i am not sure what set up is but seems like EG is storing all default datasets in it and same in work folder too...

Valued Guide
Posts: 3,206

Re: Deleting .sas7bdat via BAT file

SAS Eg is just like a terminal application. It is an interface.

Your sas-session setup and configuration is not as should be.    

---->-- ja karman --<-----
Grand Advisor
Posts: 9,576

Re: Deleting .sas7bdat via BAT file

No need to write BAT file to delete these SAS datasets .

proc datasets library=WORK KILL ;

quit;

Valued Guide
Posts: 3,206

Re: Deleting .sas7bdat via BAT file

That cleanup using proc datasets should be done as guideline by the users theirself.

  

Tech support guys  use the utilities SAS is delivering:

= SAS(R) 9.2 Companion for Windows, Second Edition (cleanup handler)

= SAS(R) 9.4 Companion for Windows, Third Edition (cleanwork like Unix)

No need to invent a own Windows invented tool. http://support.sas.com/documentation/cdl/en/hostwin/67279/HTML/default/viewer.htm#p03ktuo5yud2usn1qa...

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 5 replies
  • 478 views
  • 6 likes
  • 4 in conversation