11-20-2017 07:56 PM
As part of an if-then statement, I need to flag observations with certain codes in any of 25 variables dx1-dx25. What is the best way to do this?
if not missing(x) and...
<something translating to 123 or 234 in any of dx1-dx25>
11-20-2017 08:12 PM
Double arrays. One with the list of values you’re looking for and a second with the dx.
Then loop through the smaller array and use WHICHC to search for the values. Use a LEAVE/BREAK to exit the loop once the flag is set.
Another approach would be to make it a long data set than it’s a very easy WHERE filter on the query.
11-20-2017 08:24 PM
Can I use double arrays if this is one part of multiple ands in an if-then statement?
if not missing(x)
and died = 0
and <array statement here??>