BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
GeorgeSAS
Lapis Lazuli | Level 10
data  have;
x="aaabbbbccccdddd--abc--def";
run;

data need;
set have;
x2=compress(x,"abc");
*I want x should be "aaabbbbccccdddd----def";
run;

How to remove string  "abc" exactly from the old string?

 

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
GeorgeSAS
Lapis Lazuli | Level 10

data need;

set have;

x2=TRANWRD(x,"abc",'');

*I want x should be "aaabbbbccccdddd----def";

run;

View solution in original post

1 REPLY 1
GeorgeSAS
Lapis Lazuli | Level 10

data need;

set have;

x2=TRANWRD(x,"abc",'');

*I want x should be "aaabbbbccccdddd----def";

run;

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
  • 1 reply
  • 947 views
  • 0 likes
  • 1 in conversation