BookmarkSubscribeRSS Feed
seamoh
Obsidian | Level 7

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.

seamoh_0-1591751050070.png

 

 

12 REPLIES 12
smantha
Lapis Lazuli | Level 10
There are two ways to go about this
1. Change Sas encoding option so that it supports non native characters
2. Try using varchar instead of string for column informats and formats
ChrisNZ
Tourmaline | Level 20

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.

seamoh
Obsidian | Level 7

Hello and thank you very much for your reply. I have just SAS university edition.

 

Thank you again.

ChrisNZ
Tourmaline | Level 20
seamoh
Obsidian | Level 7

Hello and thank you very much for your answer, yes the German alphabets are distorted in SAS studio tab too.

 

Thank you very much

DavePrinsloo
Pyrite | Level 9

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;
seamoh
Obsidian | Level 7

Hi and thank you very much for your reply

 

Where should I insert the codes?

 

Thank you again

 

DavePrinsloo
Pyrite | Level 9
Run the conversion program once now, and every time immediately after importing / reading from the source table
DavePrinsloo
Pyrite | Level 9
did this work?

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 12 replies
  • 2022 views
  • 0 likes
  • 5 in conversation