BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
mkeintz
PROC Star

@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.  

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
SASKiwi
PROC Star

@mkeintz - This is the case I looked at

 

Have:

AAT(BB)ADAA(CCDC)AXC 

 

Want:

AATADAAAXC

 

Your solution gives: AATAXC 

mkeintz
PROC Star

@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.

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
SASKiwi
PROC Star

@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 🙂

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 18 replies
  • 5764 views
  • 9 likes
  • 7 in conversation