Hi all,
I'm having some issues generating customized output using excelXP.
I need to be able to display an uppercase sigma in excel output via the excelxp engine, but i cannot get the escape character to resolve to the proper unicode text.
For example, if i specify
ods escapechar="^";
prior to the rest of my code, my title statement
the text resolves to {unicode 03A3x} in the relevant title cell.
How can i get the text to resolve to the greek sigma? Or, is it simply not possible?
Any input from the experts?
I should add -- I have all of this compiling in a macro, so it is possible that the escapechar is not resolving properly due to being nested within a macro.
Hi
i tried the below code and it resolved to uppercase Sigma. Use ' (single quotes) instead of double quotes for 03A3.
ODS Escapechar='^';
Title "Sas Session ^{unicode '03A3'x}";
I tested the above code in sas enterprise guide. could you check the sas version.
Thanks,
Jag
Hi Jag,
I will look into using single quotes instead of double -- i had been using double quotes because the code is nested within a macro
some thing along these lines:
%macro excelloop;
ods escapchar="^";
ods tagsets.excelxp
filename...
title1 "Sas example ^{unicode '03A3'x)";
proc report ...;
run;
%mend;
%excelloop;
Hi:
Part of the beauty of the Unicode function with ODS ESCAPECHAR is that you do NOT need to use quotes. For example, refer to page 4 in this paper
http://www2.sas.com/proceedings/sugi31/227-31.pdf (page 4)
or look in the doc
or run this program below.
Cynthia
ods tagsets.excelxp file='c:\temp\uni_symbols.xml' style=sasweb
options(embedded_titles='yes');
ods escapechar='^';
title 'Unicode symbol is ^{unicode 03A3}';
title2 'Unicode by glyph name is ^{unicode sigma_u}';
title4 'Unicode Alpha Glyph is ^{unicode alpha}';
title3 'Unicode Beta is ^{unicode 03B2}';
title5 'Unicode Gamma is ^{unicode 03B3}';
proc print data=sashelp.class(obs=3);
run;
ods tagsets.excelxp close;
Cynthia, Jag:
In order to figure out whether the issue had to do with Excel, my macro, or my sas implementation, i rant the following code;
options nonumber nodate;
ods escapechar='^';
ods pdf file="foo.pdf";
title 'Unicode Alpha is ^{unicode 03B1}';
title2 'Unicode Alpha is ^{unicode alpha}';
title3 'Unicode Beta is ^{unicode 03B2}';
title4 'Unicode Gamma is ^{unicode gamma}';
title5 'Unicode Sigma is ^{unicode 03C3}';
proc print data=sashelp.class(obs=1); run;
ods _all_ close;
result is a pdf which the line: Unicode Sigma is ^{unicode 03C3}
I'm beginning to think that my issue is not my code, but rather my sas implementation. I am running sas 9.3 on a server, SAS TM Level 1M2 X64_ESRV08.
Is it possible that there is a package i need to install for this to all work?
Thanks,
Ben
You may just be using a font that is too limited. Have you tried?:
/* Change unicode font to something with more characters in it */
/* Copy this to 'unicode.sasxreg' */
/*
[ODS\DESTINATIONS\PRINTER]
"Unicode Font"="Arial Unicode MS"
*/
proc registry import = 'unicode.sasxreg'; run;
As suggested in: Base SAS: Enhancements to Inline Formatting in SAS 9.2
Hi:
I agree with Art. I think you have a font issue. Running your code results in the screen shot of the PDF output below.
cynthia
I resolved the issue by running my code in a SAS unicode environment, as opposed to English. Works perfectly, now.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.