BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ehsanmath
Obsidian | Level 7

Hi,

 

I am having an encoding problem with sas code files which is as follows:

The follwoing sas code is saved on a text file called "test_coding.sas" using SAS EG:

%macro test();

%put AVL und Kündigungausshaprachen Zusammenfuhren;

%mend;

 

When I recall the code as follows:

%include '....directory_Path\test_coding.sas';

%test();

 

The Output shown in LOG file has encoding problem. Here is the Output from LOG file:

%test();

AVL und K�ndigungausshaprachen Zusammenfuhren

 

The double code characters like "ü" are not read properly from the file 'test_coding.sas'.

 

Would be thankful for you Ideas.

 

regards

 

1 ACCEPTED SOLUTION

Accepted Solutions
andreas_lds
Jade | Level 19

Check the encoding of the sas-program-file. Beginning with EG 7.11 you can select the encoding when saving code files, accessible via the small, black rectangle on the SAVE-Button - see screenshot. Using unicode should solve the problem.

save.PNG

 

View solution in original post

8 REPLIES 8
ehsanmath
Obsidian | Level 7

It uses UTF-8 encoding.

Here are SAS options set in config file:

 

SAS session encoding or UTF-8 encoding.

DBCS Enables double-byte character sets for encoding East Asian languages.

DBCSLANG=UNKNOWN Specifies a double-byte character set language.

DBCSTYPE=UTF8 Specifies the encoding method to use for a double-byte character set.

ENCODING=UTF-8 Specifies the default character-set encoding for the SAS session.

LOCALE=DE_DE Specifies a set of attributes in a SAS session that reflect the language, local conventions, and culture for a

geographical region.

NONLSCOMPATMODE Encodes data using the SAS session encoding.

 

Kurt_Bremser
Super User

The Umlaut you used is encoded as hex FC (typical for wlatin/latin9 encoding), which is an invalid byte in Unicode. It works well when the SAS session runs with latin9 encoding (tested here). Did you type that code in Enterprise Guide, or did you copy/paste it from somewhere, or did you open existing code?

ehsanmath
Obsidian | Level 7

 

I type that code in Enterprise Guide, afterwords saved the code using Enterprise Guide as a sas text file.

When I source the the saved sas code on text file using "Include", I am obtaining this Umlaut coding problem.

 

Do you have an Idea how can I fix it ?

 

ehsanmath
Obsidian | Level 7

 

I save the code through Server/SASApp/Files.

andreas_lds
Jade | Level 19

Check the encoding of the sas-program-file. Beginning with EG 7.11 you can select the encoding when saving code files, accessible via the small, black rectangle on the SAVE-Button - see screenshot. Using unicode should solve the problem.

save.PNG

 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 8 replies
  • 2467 views
  • 0 likes
  • 3 in conversation