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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.