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.
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.
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?
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;
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!
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.
Ready to level-up your skills? Choose your own adventure.