The SAS Output Delivery System and reporting techniques

PROC DOCUMENT: How to delete all documents?

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 91
Accepted Solution

PROC DOCUMENT: How to delete all documents?

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.


Accepted Solutions
Solution
‎04-08-2013 04:43 PM
SAS Super FREQ
Posts: 706

Re: PROC DOCUMENT: How to delete all documents?

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
    Smiley TongueathList 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


All Replies
Frequent Contributor
Posts: 91

Re: PROC DOCUMENT: How to delete all documents?

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 ;

Solution
‎04-08-2013 04:43 PM
SAS Super FREQ
Posts: 706

Re: PROC DOCUMENT: How to delete all documents?

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
    Smiley TongueathList 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;
Frequent Contributor
Posts: 91

Re: PROC DOCUMENT: How to delete all documents?

Bruno-

Thanks so much for the answer!

Wendy

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

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