No idea what a CCI index is but I would guess the following code could be close:
data risk;
set datasets.riskdata;
if diagnosis= 'TYPE1_DM' then diagnosis='y';
if diagnosis='TYPE2_DM' THEN DIAGNOSIS='n';
if diagnosis= 'PXECTMY' then diagnosis='n';
if los<0 then los=.;
array A{10} diagnosis dialysis lipiddis cbv_ds pvd neuropthy respprob cancrpre cbypass mi;
do i=1 to 10;
A{i} = upcase(A{i});
if A{i} not in ("Y", "N") then call missing(A{i});
end;
array c{10} (2,3,2,1,1,1,1,3,1,2);
CCI = 0;
do i = 1 to 10;
if A{i} = 'Y' then CCI = CCI + c{i};
end;
drop i;
run;
... View more