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

Good morning!

I've been looking through the documentation, and can't figure out how to do deletes in the Document store without naming each item.

I'm processing several programs in batch, and trying to clean up in-between.

Thanks for your help!

WendyT.

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

Hi Wendy

You are right you have to name all entries you want to delete. But you do not have to do it manually, with the help of some code this is done automatically, see below for an example

ods output Properties=_properties;

proc document;
 
doc name=mydoc;
  list  / levels=all details follow order=insert ;
run;

quit;

proc sql number;
 
select
    path
 
into
    :pathList separated by
", "
 
from
    _properties
 
where
    type =
"Dir"
   
and countw(path, "\") = 1
  ;
quit;

%put NOTE: &=pathList;

proc document;
 
doc name=mydoc;
  title "before delete";
 
list  / levels=all details follow;
run;

 
delete &pathList;
run;

 
list  / levels=all details follow;
run;

quit;

View solution in original post

3 REPLIES 3
WendyT
Pyrite | Level 9

Folks-

I did figure out that I could get rid of the items using MEMTYPE in proc datasets, but am still interested in doing this from proc documents.

Thanks!

WendyT

PROC DATASETS LIB=WORK KILL MEMTYPE=(ITEMSTOR) ;

RUN ;

QUIT ;

BrunoMueller
SAS Super FREQ

Hi Wendy

You are right you have to name all entries you want to delete. But you do not have to do it manually, with the help of some code this is done automatically, see below for an example

ods output Properties=_properties;

proc document;
 
doc name=mydoc;
  list  / levels=all details follow order=insert ;
run;

quit;

proc sql number;
 
select
    path
 
into
    :pathList separated by
", "
 
from
    _properties
 
where
    type =
"Dir"
   
and countw(path, "\") = 1
  ;
quit;

%put NOTE: &=pathList;

proc document;
 
doc name=mydoc;
  title "before delete";
 
list  / levels=all details follow;
run;

 
delete &pathList;
run;

 
list  / levels=all details follow;
run;

quit;
WendyT
Pyrite | Level 9

Bruno-

Thanks so much for the answer!

Wendy

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
  • 3 replies
  • 1270 views
  • 3 likes
  • 2 in conversation