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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2181 views
  • 3 likes
  • 2 in conversation