Can do. I'll post a snippet and send you the complete (macro-rific) code via email. I have your address.
The code below gives me :
Medical-Adults....
BHCS and Facility Rates
this is the systemtitle
[proc report]... etc.
this is the code that calls other macros.
[pre]
ods pdf file="c:\temp\&filename. unit detail report.pdf" style=ndnqi
pdftoc=1 bookmarklist=show startpage=no contents=no;
title1 c=red "this is the systemtitle";
footnote1 "
^{style ^{unicode 2588}^{unicode 2588}^{unicode 2588}} = Below or at 25th Percentile^{nbspace 8}
^{style ^{unicode 2588}^{unicode 2588}^{unicode 2588}} = 26th-50th Percentile^{nbspace 8}
^{style ^{unicode 2588}^{unicode 2588}^{unicode 2588}} = 51st-75th Percentile^{nbspace 8}
[no fill] = Above 75th Percentile"
;
footnote2 j=l h=10pt c=gray "Facility values are the median of all the units which make up that unit type. BHCS is average of facility values.";
footnote3 j=l c=gray h=10pt 'Benchmarks are from the NDNQI "All Hospital" Report, 2009 Q1'
j=r h=8pt "Prepared %sysfunc(today(),mmddyy8.) Baylor IHCRI";
%make_detail_table(measure=totalfall_rate, label=Falls per 1000 Patient Days, my_fmt=monyy5., meas_fmt=8.2);
ods pdf startpage=now;
%make_detail_table(measure=injfall_rate, label=Injury Falls per 1000 Patient Days, my_fmt=monyy5., meas_fmt=8.2);
ods pdf close;
[/pre]
Here is the start of the macro "make_detail_table"
[pre]
%macro make_detail_table(measure=, label=, my_fmt=, meas_fmt=);
%let numtype=Percentages;
%if "&measure."="totalfall_rate" or "&measure."="injfall_rate" %then %let numtype=Rates;
/* SYSTEM AND FACILITY TABLE */
* ods label and text for page and table titles;
ods proclabel "System/Facility &label.";
%if "&unittype."="n/a" %then %do;
ods pdf text="^{style [fontsize=14pt color=cx0077D4 fontweight=bold] Non-NDNQI Units - &label.} ";
%end;
%else %do;
ods pdf text="^{style [fontsize=14pt color=cx0077D4 fontweight=bold] &unittype. Units - &label.} ^n";
%end;
ods pdf text="^2n^{style [outputwidth=100% just=c fontsize=12pt color=black] BHCS and Facility &numtype.} ^2n";
* make system/facility table;
proc report data=use_for_detail nowd
style(report)=[font_size=8pt rules=all bordercolor=darkgray cellpadding=2pt ]
;
where &measure.^=. and unit_name=" " and unit_type="&unittype.";
columns order_fac facility month_year,( &measure. &measure._qtile );
/* end snippet of macro */
[/pre]