BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8

A+(B+C)

(A+B)+C

(A+B+C)

 

How to remove brackets so the string is A+B+C?

5 REPLIES 5
PeterClemmensen
Tourmaline | Level 20

Use COMPRESS Function like this

 

data have;
input string $;
datalines;
A+(B+C)
(A+B)+C
(A+B+C)
;

data want;
   set have;
   string=compress(string, "()");
run;
Sri4_
Calcite | Level 5
how to remove parenthesis in a given string.
in my data having values like 22.9() and 1.9(mg/dl).
i want to remove only () in 22.9() not in 1.9()
PeterClemmensen
Tourmaline | Level 20

Please open a new thread and describe your problem there. 

 

This thread is 3 years old 🙂

Sri4_
Calcite | Level 5
can you please tell me how can i open new thread.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 5 replies
  • 7389 views
  • 2 likes
  • 4 in conversation