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.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!

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