OK.
I will try it. It is much complicated.
[pre]
data test;
input patient sex $ Diabetes ;
cards;
1 M 1
2 M .
3 M 1
4 M 1
5 M 2
6 M 1
7 F .
8 F 2
9 F 2
10 F 2
11 F 1
12 F .
;
run;
proc format;
value diabetes
.='Unknown'
1='Diabetic'
2='Non-diabetic'
;
run;
ods pdf file='c:\x.pdf' style=sasweb;
proc report data=test nowd completerows out=see;
column diabetes sex,(n percent);
define diabetes /group format=diabetes. preloadfmt exclusive missing order=internal;
define sex /across;
define percent/'ColPctN' computed format=percent8.;
compute before;
sum1=_c2_ ;
sum2=_c4_;
endcomp;
compute percent;
if missing(diabetes) then do;
_sum1=sum1-_c2_;
_sum2=sum2-_c4_;
end;
else do;
_c3_=_c2_/_sum1;
_c5_=_c4_/_sum2;
end;
endcomp;
compute after /style={just=right asis=on};
str=cat('All : ',sum1,' 100% ',sum2,' 100%');
line str $200.;
endcomp;
run;
ods pdf close;
[/pre]
Ksharp
... View more