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.
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
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;
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.
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.