BookmarkSubscribeRSS Feed
bullman
Calcite | Level 5

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?

8 REPLIES 8
bullman
Calcite | Level 5

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.

Jagadishkatam
Amethyst | Level 16

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

Thanks,
Jag
bullman
Calcite | Level 5

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;

Cynthia_sas
SAS Super FREQ

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

http://support.sas.com/documentation/cdl/en/odsug/66611/HTML/default/viewer.htm#p11xia2ltavr8ln17srq...

http://support.sas.com/documentation/cdl/en/grstatug/63302/HTML/default/viewer.htm#n14y94tov3cxxjn1v...

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;

bullman
Calcite | Level 5

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

art297
Opal | Level 21

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

Cynthia_sas
SAS Super FREQ

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


show_glyphs.png
bullman
Calcite | Level 5

I resolved the issue by running my code in a SAS unicode environment, as opposed to English.  Works perfectly, now.

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
  • 8 replies
  • 2193 views
  • 1 like
  • 4 in conversation