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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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