Hi, I'm trying to flag all individuals with diagnosis codes E10, E11, and E13. The problem is, I would like this to include all values for that overarching diagnosis code. So for example, if there are diagnosis codes E11.17, E11.21, E11.34, E10.22, E13.49, I would like to flag any with E10, E11, or E13 to be flagged. My code is below and thanks in advance for any help! data work.diabetes_control_num; set work.diabetes_control; array diag{3} $ diagnosis_1 diagnosis_2 diangosis_3; array a1c_last{1} a1c2; do i= 1 to 1; if a1c_last{i} >= 9 then dm_control=0; else if a1c_last{i}=. then dm_control=.; else dm_control=1; end; do i=1 to 3; if diag{i} = in ("E10", "E11", "E13") then diag_control=1; else diag_control=0; end; run;
... View more