BookmarkSubscribeRSS Feed
Thomas1981
Calcite | Level 5

Hallo,

 

can anybody help me?

I have to create Format-libraries with umlauts and sorbian characters. If i choose SASApp umlauts will be translated but there is an error for sorbian characters. If i choose SASApp_utf8 sorbian characters are translated but umlauts are not. SAS-Version is 9.4M7.

4 REPLIES 4
ballardw
Super User

Without more details search this forum for UNICODE and FORMAT. You should be able to create strings with either/both that are honored in use. 

 

andreas_lds
Jade | Level 19

Sorry, but i don't understand the problem.

SASApp_utf8 is just a name, you have to check the encoding option to verify that unicode is active. Unicode supports both sorbian chars and umlauts. 

Can you show the code and the result?

 

 

Tom
Super User Tom
Super User

You cannot use the same format with two different encodings.  That is because the bytes used to represent the characters differ depending the encoding you are using.  Consider a lower case n with tilde over it.  It is 'F1'x in LATIN1 encoding and 'C3B1'x in UTF-8 encoding.

25   data test;
26     enye = 'F1'x ;
27     put enye= enye $hex2. ;
28     utf8 = kcvt(enye,'latin1','utf-8');
29     put utf8= $hex4.;
30   run;

enye=ñ F1
utf8=C3B1

You will probably want to create two different format CATALOGs.  (They could be in the same LIBRARY if you want, just use different names for the catalogs.)

proc format lib=mylib.utf8;
  value ....

Then just change which one you include in your FMTSEARCH system option based on what encoding your current session is using.

 

Or you could make two different formats and then decide which format to use based on the encoding.

proc format ;
  value latin1f 1='F1'x;
  value ut8f 1='C3B1'x ;
run;

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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
  • 4 replies
  • 1345 views
  • 2 likes
  • 5 in conversation