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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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