BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Sarvendra
Fluorite | Level 6

Hi All

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

1 ACCEPTED SOLUTION

Accepted Solutions
6 REPLIES 6
PGStats
Opal | Level 21

proc datasets library=WORK kill; run; quit;

PG
Altal
Calcite | Level 5

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

PROC DATASETS LIB=work NOlist MEMTYPE=data kill;

RUN; QUIT;

ballardw
Super User

<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.

Altal
Calcite | Level 5

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.

art297
Opal | Level 21

Ah, but the OP DID say the work DIRECTORY

ravigiit44
Calcite | Level 5

proc delete data=work._all_;run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 35849 views
  • 6 likes
  • 6 in conversation