Hello! My dataframe consists of many rows and 25 columns sequentially labeled 'diagx1' to 'diagx25'. Each row represents an individual presenting with one or more health conditions (diagx). There are many different conditions (10,000+), though some are more common than others. Multiple individuals can have the same condition. I wish to narrow my dataframe down to 20 conditions: if any individual has one of these conditions in 'diagx1' to 'diagx25', I want them to remain in my dataframe. I have considered using multiple if statements, though I was wondering if someone had a more elegant solution. For example, say the 10 conditions were: NN1, NN2, NN3, QQ1, QQ2, QQ3, OO1, OO2, OO3, V1, V2 data hosp_prac; set hosp; if diagx1 = NN1 or diagx1 = NN2 or diagx1 = NN3... or diagx2 = NN1 or diagx2 = NN2 or diagx2 = NN3... or diagx3 = NN1 or diagx3 = NN2... ....then output; run; Any help would be greatly appreciated! I hope its clear enough - this is my first time posting - I'm not even sure if this belongs in this location. Thanks!
... View more