Hello,
is it possible to use wildcards in PROC DOCUMENT. For example I would like to perform the same action on all objects within a document directory.
proc document name=test;
dir \listings;
obpage \LISTING#1\Report#1\Report#1\Report#1 / after delete;
obpage \LISTING#1\Report#2\Report#1\Report#1 / after delete;
obpage \LISTING#1\Report#3\Report#1\Report#1 / after delete;
run;
quit;
replace with
proc document name=test;
dir \listings;
obpage \LISTING#1\* / after delete;
run;
quit;
anyone know if this is possible?
kind regards,
Richard
thanks, yes this would be an acceptable solution. I have not checked yet but is it possible to extract the number of reports for the %do loop value?
Ok, you can do this using proc sql and Dictionary tables:
(https://documentation.sas.com/?docsetId=lrcon&docsetTarget=p00cato8pe46ein1bjcimkkx6hzd.htm&docsetVe... )
proc sql;
select count(distinct memname) /* not sure it’s memname, view table to verify */
:into &nrep
from dictionary.tables /* not sure it's .tables, check above website to verify */
where libname = “YOUR_CATALOG”
;
quit;
%put &nrep; *check in log that there is something there;
Please make sure that name of library is in capital letters.
Nearly 200 sessions are now available on demand with the SAS Innovate Digital Pass.
Explore Now →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.
Ready to level-up your skills? Choose your own adventure.