BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SASdevAnneMarie
Barite | Level 11

Hello Experts,

 

I would like to replace the "â" by "a" and the "ô " by "o" in the column My_data.

Could I use TRANWRD function with multiple arguments like My_data2=TRANWRD(My_data,"â",a,"ô",o)  ?

There is some function that runs with multiple arguments please  and replace the character?

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Check you ENCODING setting.  You can check the automatic macro variable SYSENCODING.

 

If you are using a single byte encoding like WLATIN1 then solution like in this question using TRANSLATE() will work.

Otherwise if you are using a multi-byte encoding like UTF-8 then you will need to use the KTRANSLATE() function instead.

 

View solution in original post

4 REPLIES 4
PaigeMiller
Diamond | Level 26

I think the TRANSLATE function does what you want.

--
Paige Miller
Tom
Super User Tom
Super User

Check you ENCODING setting.  You can check the automatic macro variable SYSENCODING.

 

If you are using a single byte encoding like WLATIN1 then solution like in this question using TRANSLATE() will work.

Otherwise if you are using a multi-byte encoding like UTF-8 then you will need to use the KTRANSLATE() function instead.

 

SASdevAnneMarie
Barite | Level 11
Thank you, Tom !
That works !
Ksharp
Super User
Also check function BASECHAR()

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
  • 4 replies
  • 2349 views
  • 3 likes
  • 4 in conversation