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:
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:
My SAS Studio session is WLATIN1.
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?
What happens if you tell SAS that the program file is using UTF-8?
filename pgm "temp.sas" encoding='utf-8';
%include pgm / source2;
What happens if you tell SAS that the program file is using UTF-8?
filename pgm "temp.sas" encoding='utf-8';
%include pgm / source2;
Is the configuration file accessible by you? Can you update it:
If positive change the encoding code to UTF-8.
No, I don't think I have the access.
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.