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 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 10 replies
  • 1846 views
  • 2 likes
  • 3 in conversation