data Vas_DAD1819_Sum; set test.DAD1819;
array int_code[20] INTERV_CODE_01 - INTERV_CODE_20;
array ooh[20] INTERV_OOH_IND_01 - INTERV_OOH_IND_20;
array status[20] INTERV_STATUS_ATTRIB_01 - INTERV_STATUS_ATTRIB_20;
array location[20] INTERV_OR_LOC_01 - INTERV_OR_LOC_20;
array duration[20] INTERV_EPISODE_DURATION_01 - INTERV_EPISODE_DURATION_20;
Vascular=0;
do i=1 to 20;
if substr(int_code[i], 1, 5) in : ('1VC91','1VC93', '1VX59', '1DA89', '1ET89', '1TK93', '1TV93', '1TX59', '1UE93',
'1UF93', '1UI93', '1UJ93', '1UY59', '1WK93', '1WL93', '1WV59', '1JX87','1KA50', '1KA53', '1KA76', '1KA80', '1IA80',
'1IB57', '1IB80', '1ID57', '1ID76', '1ID80', '1ID86', '1ID87', '1JE80', '1JE87', '1JM80', '1JM87', '1JX87', '1KA50',
'1KA82', '1KE80', '1KG50','1KG80', '1KA76', '1KG51', '1KG57', '1KG76', '1KG80', '1KG82', '1KG87', '1JE76',
'1JJ76', '1JK76', '1KA76', '1KT51', '1KT76', '1KY76', '1JE57', '1JD59', '1JJ50', '1JJ51', '1JJ57', '1JJ80',
'1JK80', '1JM50', '1JM51', '1JM57', '1JM80', '1JM82', '1JM87', '1JW86', '1KG50', '1KG51', '1KG57', '1KG80', '1KG87', '1KT50',
'1KT51', '1KT80', '1KV13', '1KY50', '1KY57', '1KY76', '1KY80', '1KZ51', '1KZ86', '1SZ52', '1IC50', '1IC76', '1IC80', '1IC87',
'1KA57', '1KA87', '1KE50', '1KE51', '1KE57', '1KE76', '1KE87', '1NV89', '1IS53', '1JQ80', '1JU51', '1JU57', '1JU80', '1JU87','1JW86',
'1KQ80', '1KR50', '1KR51', '1KR57', '1KR58', '1KR59', '1KR76', '1KR80', '1KR87', '1KZ86')
and ooh[i]~='Y' and status[i]~='A' and location[i] = '01' then do;
Vascular=1;
dur=duration(i);
output;
end;
end;
drop i;
if Province_Issuing_HCN='ON' and Responsibility_for_Payment='01' and hcn_index='H'
and Age >=18
and hcne^='9999999999'
and gender in ('M' , 'F') then output;
run; I just checked one record and I note that the intervention of interest is present in position 4 but the OR_LOC is not equal to 1 but the vascular is still equal to 1 Would you be able to advise why? In addition, how would I create a summary to show the following: 1IS53 for e.g. is in my syntax, so for all the records that have 1IS53 as an intervention what is the average and median (duration) Intervention Duration 1IS53 50
... View more