Help with replace text

Accepted Solution Solved
Reply
Super Contributor
Posts: 406
Accepted Solution

Help with replace text

Hello Everyone,

I am using prxchange to replace text. I can replace the string '&& &&' but can not do with '&& )'.

Can you show me how to fix it?

Many thank and have a nice weekend.

HHC

data have;

input old $20. ;

datalines;

change1 && && face

change2 && && askljklj

change3 dfa

xlx && )

nochange &&    )

;

run;

data want;

   set have;

   new = prxchange('s/&& &&/&&/', 1, old);

  

  new2 = prxchange('s/& )/)/', 1, old);

run;


Accepted Solutions
Solution
‎03-01-2014 10:08 PM
Super Contributor
Posts: 406

Re: Help with replace text

oh I got it.

data one;

input old $20. ;

datalines;

change1 && && face

change2 && && askljklj

change3 dfa

xlx & )

run;

data two;

   set one;

   new = prxchange('s/&& &&/&&/', 1, old);

   new2 = prxchange('s/& \)/kkk/', 1, old);

run;

View solution in original post


All Replies
Solution
‎03-01-2014 10:08 PM
Super Contributor
Posts: 406

Re: Help with replace text

oh I got it.

data one;

input old $20. ;

datalines;

change1 && && face

change2 && && askljklj

change3 dfa

xlx & )

run;

data two;

   set one;

   new = prxchange('s/&& &&/&&/', 1, old);

   new2 = prxchange('s/& \)/kkk/', 1, old);

run;

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 146 views
  • 0 likes
  • 1 in conversation