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

Hi,

 

I am trying to use the code in https://www.pharmasug.org/proceedings/2013/CC/PharmaSUG-2013-CC30.pdf

data _null_;
do k=1 to 255;
x=byte(k);
put k+10 x;end;
run;

 

but in the log, some characters are not displayed correctly.

 

spec char.png

 

 

How to fix this? i tried to change the sas font, but it seems not working.

 

Only some fonts are available in my SAS9.4

sas font.png

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi: My guess is that you have to figure out how to change the font in the log for display purposes. That's probably a question for Tech Support.

cynthia

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi, I recommend NOT writing to the LOG, or the OUTPUT window. Instead make a SAS dataset and use PROC PRINT so you can control the font and specify a UNICODE font for the output. I like the RTF or PDF example because with COLUMNS= it makes a nice 1 page job aid.

 

cynthia

 

data special;
do k=1 to 255;
  x=byte(k);
  output;
end;
run;

options rightmargin=.5in leftmargin=.5in center nodate nonumber;
ods html file='c:\temp\showspecial.html';
ods rtf file='c:\temp\showspecial.rtf' columns=8;
ods pdf file='c:\temp\showspecial.pdf' columns=8;
proc print data=special noobs
  style(data)={fontface='Arial Unicode MS'};
  title 'Special Characters in Unicode Font';
run;
ods _all_ close;
ifendo
Obsidian | Level 7

Thank you very much,Cynthia. Yes, my default output is HTML and the unicode is not an issue to HTML.

But actually sometimes there is a need to investigate the special characters in the log for debuging, such as the nested macro call.

 

so is there a way to display the special characters correctly in the log? i tried all the currently available fonts in my SAS9.4, but the special characters(like "é") are replaced by a "?" in the log. so can i add some more fonts to my SAS9.4 to support the unicode in the log and how to do that? 

 

Many thanks in advance.

Cynthia_sas
SAS Super FREQ
Hi: My guess is that you have to figure out how to change the font in the log for display purposes. That's probably a question for Tech Support.

cynthia

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
  • 3 replies
  • 2877 views
  • 1 like
  • 2 in conversation