Thanks for your feedback! I tried this approach with a macro, and I am surprised that not only did it work, but I think it works more accurately than the weird solution I came up with. I tried the following approach and it ended up giving me a smaller resulting sample size. I cannot figure out how the following code and your code give a different result because my code is just getting at if there is at least 1 ICD10 value where the category your suggested code restated in this context: %let icd10 = 'F10', 'Z7141', 'K70', 'D50', 'D51', 'D52', 'D53', 'D55', 'D56', 'D57', .....; data op_fac_icd10_a1; set op_fac_a1; if dx1 in: (&icd10.) or dx2 in: (&icd10.) or dx3 in: (&icd10.) or dx4 in: (&icd10.) or dx5 in: (&icd10.); run; the code I ended up using is listed below where I ended up referencing ICD10 values in a variable in a table called pedcomindex: proc sql; create table op_fac_icd10_a1 as select* from op_fac_a1 where ( exists (select 1 from pedcomindex where dx1 like '%'||icd10||'%') or exists (select 1 from pedcomindex where dx2 like '%'||icd10||'%') or exists (select 1 from pedcomindex where dx3 like '%'||icd10||'%') or exists (select 1 from pedcomindex where dx4 like '%'||icd10||'%') or exists (select 1 from pedcomindex where dx5 like '%'||icd10||'%') ); quit; Any thoughts? Thanks so much again for your response!
... View more