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

I am a SAS 9.4 and Studio 3.81 user. I created a script at SAS Studio like this:

 

data temp;
a='hello “X”';
run;

 

I save this script as 'temp.sas' and notice its encoding is utf-8 from Notepad++. Then I ran the script at Studio, the Unicode characters can be shown correctly:

abcg_0-1611239494428.png

 

But when I attempted to write another script using %include statement to call this script:

 

%include "temp.sas";

The output dataset cannot display the Unicode character:

 

abcg_1-1611239619344.png

 

My SAS Studio session is WLATIN1.

 

abcg_0-1611238915859.png

 

It's weird it can display Unicode correctly if open the script by selecting the file from "Files and Folders" under Studio. But when I drag the file from Windows File Explorer to Studio and attempt to open it, I get this:

 

data aaa;
a='hello “X”';
run;

Any solution of this at Studio to make Unicode character being displayed correctly anywhere, in dataset and in output report?

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

What happens if you tell SAS that the program file is using UTF-8?

filename pgm "temp.sas" encoding='utf-8';
%include pgm / source2;

View solution in original post

4 REPLIES 4
Tom
Super User Tom
Super User

What happens if you tell SAS that the program file is using UTF-8?

filename pgm "temp.sas" encoding='utf-8';
%include pgm / source2;
abcg
Fluorite | Level 6
Yes, it works. It can print out the same as on the script.
Shmuel
Garnet | Level 18

Is the configuration file accessible by you? Can you update it:

If positive change the encoding code to UTF-8.

abcg
Fluorite | Level 6

No, I don't think I have the access.

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
  • 4 replies
  • 1013 views
  • 3 likes
  • 3 in conversation