@SASKiwi wrote:
@mkeintz - Nice correction, but then I realised my attempt doesn't doesn't cater for multiple sets of parenthises so I think that a DO UNTIL (or WHILE) loop is still needed for that case.
@SASKiwi I don't think a DO loop is required. My understanding is that all text from the left outer paren through the right outer paren is to be eliminated, leaving the leftmost "word" preceding the first "(" and the rightmost word following the last ")". No need to account for interior parens.
@mkeintz - This is the case I looked at
Have:
AAT(BB)ADAA(CCDC)AXC
Want:
AATADAAAXC
Your solution gives: AATAXC
@SASKiwi wrote:
@mkeintz - This is the case I looked at
Have:
AAT(BB)ADAA(CCDC)AXC
Want:
AATADAAAXC
Your solution gives: AATAXC
Ah. Right you are.
@mkeintz - I thought about it long and hard and realised that any non-PRX solution is likely to be no better than the PRX one 🙂
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.