Hello! I have been stuck on this issue for a long time and would be super grateful if anyone could help! I have a variable that contains a long string of test results: "blood-neg, blood-neg, blood-pos, serum-neg, blood-pos, serum-neg, blood-pos, blood-neg, blood-pos" in this string I am specifically looking to find the position of the phrase "serum-neg, blood-pos" I have been using this code to find the position: result=findw(newvar_test, 'serum-neg, blood-pos', ' ' , 'E'); in the example above, the result I get is 4- which is correct! However, I would also like to get a result that says 6 since this is the position of the next occurrence of this phrase. No matter what I do, I am unable to figure this out. It is also tricky because the dataset contains thousands of observations and all of them have different test result variable lengths and orders. Is there a way that I can get SAS to return all positions of the same phrase among this large string of test results? Thanks!
... View more