BookmarkSubscribeRSS Feed
USP2405
Obsidian | Level 7

I am using translate function to replace these all vowels into their case equivalent. Since these vowels are with special values translate function is not working for me. Can anyone please help on it?

e.g. 

translate from - 'à' , 'À' , 'è' , 'È' , ''î' , 'Î' , 'ô' , 'Ô'

Translate to - a, A, e, E, i, I, o, O

1 REPLY 1
BrunoMueller
SAS Super FREQ

You could use the BASECHAR function to do this, like so:

 

data want;
  text = 'abc*àÀèÈîÎôÔ*def' ;
  baseText = basechar(text);
run;

SAS Viya is always running with UTF-8 encoding, some function are byte based and will not work with UTF-8 encoding.

 

You can also use the KTRANSLATE function, just replace TRANSLATE with KTRANSLATE

SAS INNOVATE 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Discussion stats
  • 1 reply
  • 133 views
  • 1 like
  • 2 in conversation