Based on this example https://communities.sas.com/t5/ODS-and-Base-Reporting/PROC-REPORT-different-formats-for-different-rows/td-p/403157 I wrote the following code. See the last 3 compute blocks. proc format;
picture custpct low-high='0009.9%' (mult=10); /* Adjust format as needed */
run;
proc report data=Tbl1;
col GrpVar Lab Total MA_PDs PDPs;
define GrpVar / Group noprint;
define Lab / '' Group order=data;
define Total / format=comma12.;
define MA_PDs / format=comma12.;
define PDPs / format=comma12.;
compute before GrpVar / style = {just=left font_weight=bold};;
length brkline $100;
if grpVar=1 then brkline='Plans';
else if grpVar=2 then brkline='Plans by tier count';
else if GrpVar=3 then brkline='Formularies';
else if GrpVar=4 then brkline='Beneficiaries';
line brkline $100.;
endcomp;
compute Total;
if Lab='Percent' then call define('_c3_','format','custpct.');
endcomp;
compute MA_PDs;
if Lab='Percent' then call define('_c4_','format','custpct.');
endcomp;
compute PDPs;
if Lab='Percent' then call define('_c5_','format','custpct.');
endcomp;
run; It ran. However, for some reason, the percentages are truncated. The second "Percent" row as some double counting, but can I get the first and third to sum to 100.0%? Table 1: Number of Plans and Formularies for PDPs and MA-PDs in 2025 Total MA-PDs PDPs Plans Number 5,244 4,770 474 Percent 100.0% 90.9% 9.0% Plans by tier count None 2 2 0 one 260 260 0 two 28 28 0 three 1 1 0 four 39 39 0 five 3,941 3,467 474 six 957 957 0 seven 16 16 0 Formularies Number 384 346 40 Percent 100.0% 90.1% 10.4% Beneficiaries Number 46,481,848 28,266,979 18,214,869 Percent 100.0% 60.8% 39.1%
... View more