Hello all of my friend , hope all of you are very well. I have a dataset contained German alphabets in Customer Name column. special German alphabet is distorted in dataset and all the reports and list taken from that.(as you see in the screen shot below). I use sas studio university edition.
I am looking forward your answers..
Thank you and deeply appreciated.
SAS UE uses UTF-8 encoding.
It looks like your data set uses sometime else.
1. Do you have any messages in the log?
2. Run proc contents and report.
Does the dataset look right when viewed in SAS Studio?
Hello and thank you very much for your reply. I have just SAS university edition.
Thank you again.
SAS Studio is the user interface used in University Edition.
PS it is the second tab in the screenshot you posted.
Hello and thank you very much for your answer, yes the German alphabets are distorted in SAS studio tab too.
Thank you very much
This has happened to me, when I got data that had been previously transferred incorrectly between Latin and UTF8.
The following code fixed it for me.
/* adjust the following to add all corrupted German char variables */
%let vars_with_corrupted_chars=name address ;
data corrected;
set has_incorrect_german_chars;
array __array_char_vars $ &vars_with_corrupted_chars.;
/* following code using explicit special characters is a LOT faster than the
equivalent code below using hex values */
__array_char_vars = prxchange('s/Ä/Ä/',-1,__array_char_vars);
__array_char_vars = prxchange('s/ä/ä/',-1,__array_char_vars);
__array_char_vars = prxchange('s/€Ã/ä/',-1,__array_char_vars);
__array_char_vars = prxchange('s/Ö/Ö/',-1,__array_char_vars);
__array_char_vars = prxchange('s/ö/ö/',-1,__array_char_vars);
__array_char_vars = prxchange('s/ü/ü/',-1,__array_char_vars);
__array_char_vars = prxchange('s/Ãœ/Ü/',-1,__array_char_vars);
__array_char_vars = prxchange('s/ÃŒ/ü/',-1,__array_char_vars);
__array_char_vars = prxchange('s/ß/ß/',-1,__array_char_vars);
__array_char_vars = prxchange('s/é/É/',-1,__array_char_vars);
__array_char_vars = prxchange('s/²/2/',-1,__array_char_vars);
__array_char_vars = prxchange('s/³/3/',-1,__array_char_vars);
__array_char_vars = prxchange("s/´/'/",-1,__array_char_vars);
run;
Hi and thank you very much for your reply
Where should I insert the codes?
Thank you again
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.