Hi all - I have a data set with variables dx1, dx2, dx3...dx25 (example below). I only want to keep observations with a value that begins with 2775 (that would be #1, 2, and 4). Note that not all values are the same length. Is there a way to do this without regex?? Conversely, how do I exclude values? For example, take out observations that have values starting with 727 (#2). data; input dx1 dx2 dx3; cards; 27756 826 79883 78399 2775 7274 99462 62294 677 48268 54981 27752 18872 992 27274 ; Right now, all I have is a very clunky brute force method. It works but it's a pain in the butt every time I want to add or subtract a new criteria. data sorted; set data; if dx1 in ('2775', '27751, '27752', '27753, '27754', '27755', '27756', '27757', '27758', '27759') if dx2 in ('2775', '27751, '27752', '27753, '27754', '27755', '27756', '27757', '27758', '27759') or dx3 in ('2775', '27751, '27752', '27753, '27754', '27755', '27756', '27757', '27758', '27759') ; run; Thanks in advance!
... View more