Write one line of code to delete everything in the WORK directory?

Reply
Contributor
Posts: 20

Write one line of code to delete everything in the WORK directory?

Hi All

Can you please guide me in write one line of code to delete everything in the WORK directory?

Respected Advisor
Posts: 4,919

Re: Write one line of code to delete everything in the WORK directory?

Posted in reply to Sarvendra

proc datasets library=WORK kill; run; quit;

PG
Contributor
Posts: 62

Re: Write one line of code to delete everything in the WORK directory?

If you want to delete ONLY datasets, you can modify PGStats code to:

PROC DATASETS LIB=work NOlist MEMTYPE=data kill;

RUN; QUIT;

Super User
Posts: 11,336

Re: Write one line of code to delete everything in the WORK directory?

Posted in reply to Sarvendra

<Tongue in cheek mode on> Work Directory? SAS uses LIBRARIES, we don't use no steeking directories!

<Tongue in cheek mode off>

Seriously since the WORK LIBRARY  could refer to a directory like C:\users\name\AppData\Local\Temp\SAS Temporary Files\_TD12345 it is a good idea to keep terminology straight to avoid possible serious confusion.

Because I do have a Work directory and it is not the same as my Work library. Deleting contents of one, the LIBRARY, would be a minor inconvenience as it is for temporary data sets. The other could potentially mean recreating hours if not days of work as it contains output products and documents.

Contributor
Posts: 62

Re: Write one line of code to delete everything in the WORK directory?

LIB=Work means the temporary SAS session library within the environment. It won't affect any other physical directory on the Network or the station.

PROC Star
Posts: 7,467

Re: Write one line of code to delete everything in the WORK directory?

Ah, but the OP DID say the work DIRECTORY

Ask a Question
Discussion stats
  • 5 replies
  • 1946 views
  • 0 likes
  • 5 in conversation