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

Hi

 

Hoping to get some help. Is there a way to create a dataset that convert from Maori to Māori?

 

data one;

length name $30;
input name;
datalines;
Maori
;
run;

1 ACCEPTED SOLUTION

Accepted Solutions
10 REPLIES 10
ChrisNZ
Tourmaline | Level 20

And do you have a list of words that match cafe to café?

ChrisNZ
Tourmaline | Level 20

é uses an acute accent by the way. A macron is horizontal, as in Māori.

ywon111
Quartz | Level 8
I actually have a big dataset with people's ethnicity and Maori, NZ Pākehā is the two that needs to be reformatted so it can be presented in a proper way.
ChrisNZ
Tourmaline | Level 20

If this fails you'll have to use K functions. Sorry I can't test as I don't have UTF8 handy. KTRANWRD doesn't exist, so you'll have to do something a bit more convoluted.

Tom
Super User Tom
Super User

There is no need for KTRANWRD() as TRANWRD() already handles replaces strings with strings that have a different number of bytes.

ywon111
Quartz | Level 8

Thanks!! Threw an error but almost there I think. Any help will be much appreciated.

 

if Ethnic_group="Maori" then Ethnic_group="Māori";

 

Error:

An error occurred executing the workspace job "XXX".

Integration technologies failed to submit the code. [Error'

Failed to transcode data from U_UTF8_CE to U_LATIN1_CE encoding because it contained characters which are not supported by your SAS session encoding. Please review your encoding= and locale= SAS system options to ensure that they can accommodate the data that you want to process.

 

ChrisNZ
Tourmaline | Level 20

You use wlatin1 encoding.

This encoding does not know what character ā is. It cannot store it.

You need your SAS session to use another encoding, probably UTF8.

Encoding is a SAS startup option, and it will also change the encoding used by your SAS data sets.

 

 

 

ywon111
Quartz | Level 8
Is there a step by step process to add UTF8 encoding to allow other users running the code to show the macrons?

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


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
  • 10 replies
  • 2174 views
  • 2 likes
  • 3 in conversation