Hi everyone I need to get type 2 diabetes patients from claims data by using ICD 9 AND 10 Codes. when I ran the following code I got Type 1 diabetes patients as well because ICD9 codes of type 2 and 1 start with 250. data Array; set MED; array d(9)$ MEDICAL_PRIMARY_DIAGNOSIS_CODE MEDICAL_DIAGNOSIS_CODE_2-MEDICAL_DIAGNOSIS_CODE_9; do i=1 to 9; DM=0; DM1=0; DM2=0; if substr (d(i),1,3) = 'E11' then DM1=1; if substr (d(i),1,3) = '250' then DM2=1; if DM1=1 or DM2=1 then DM=1; else DM=0; end; drop i; run; For type 1 diabetes I have these icd 9 codes to delete but i incorporate it into the above array code it gave 0 observations. if substr (d(i),1,5) IN ('25001', '25003', '25011', '24013', '25021','25023', '25031', '25033', '25041', '25043', '25051','25053', '25061', '25063', '25071','25073','25081','25083','25091','25093') THEN DM=1; if DM=1 then delete; Please guide
... View more