SAS Programming

DATA Step, Macro, Functions and more
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-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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
  • 7052 views
  • 2 likes
  • 4 in conversation