Weird Japanese symbols are being printing when I try to use following code to get Superscripts for my column headers:
%let x=%sysfunc(byte(185));
%put &x;
%let y=%sysfunc(byte(178));
%put &y;
define name / order order=data width=12 left flow "Name/~Family Name&x./~Age/Surname&y.";
I use SAS 9.4.
If I generate a RTF file everything is fine but when i try to generate WORD file these symbols (ケ,イ) show up in my report instead of ¹ and ².
Has anybody faced similar kind of thing before ? Please Help.
What's the default language set up on your computer?
@himanshu1105 wrote:
Weird Japanese symbols are being printing when I try to use following code to get Superscripts for my column headers:
%let x=%sysfunc(byte(185));
%put &x;%let y=%sysfunc(byte(178));
%put &y;
define name / order order=data width=12 left flow "Name/~Family Name&x./~Age/Surname&y.";
I use SAS 9.4.
If I generate a RTF file everything is fine but when i try to generate WORD file these symbols (ケ,イ) show up in my report instead of ¹ and ².
Has anybody faced similar kind of thing before ? Please Help.
It is English.
The characters with ASCII codes above 127 are FONT dependent.
You want to look to using UNICODE symbols as the font being used is doing something odd, likely using something that is not a simple ASCII encoding so extra byte(s) are added to the characters shifting them to oddness.
What ODS Style are you using when creating that RTF file?
Thanks for the reply.
I use ods style = analysis. That's what the workplace standards are.
Thanks for the reply.
I use ODS style = analysis. That's what the workplace standards are.
When I run this code:
ods rtf file='d:\junk.rtf' style=styles.analysis; data _null_; file print; put "Name/~Family Name&x./~Age/Surname&y."; run; ods rtf close;
I get
|
-------------------------------------------------------------------------------------------------- |
|
Name/~Family Name¹/~Age/Surname² |
which shows the superscripts. See if you get a similar result pointing to a valid location for the file of course. (Pasting rtf tables sucks on this site)
Thanks for the reply.
I use the following code to:
%macro special_char(unicode=, name=);
%global &name;
data _null_;
A=input("&unicode."x,$UCS2B4.);
call symput("&name.",trim(left(A)));
stop;
run;
%put Note: special_char: &name = ->|&&&name.|<- ;
%mend;
%special_char(unicode=00B9,name=super1);
%special_char(unicode=00B2,name=super2);
I get the RTF, right.
But as i run VBScript to convert it to .DOCX the 1,2 get converted to ケ and イ.
This is really weird, as this is happening for only one file. I use the same code for all the files and other outputs look fine.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.