BookmarkSubscribeRSS Feed
JohnChen_TW
Quartz | Level 8

Hi all, 

 

I'm having an issue that I'd like to display the Greek letters in excel output, but it cannot work with ods escapechar="^"; Why?

The following is my code.

 

ods escapechar="^";
%let a=^{unicode 03B2};

data want;
length x $20;
x="&a";
run;

proc export data = want
   outfile ="~path\result.xls"
   dbms = excel replace;
run;

It's always shown as ^{unicode 03B2} in excel file...but it can work properly when outputs as RTF file...why?

 

 

ods escapechar="^";
%let a=^{unicode 03B2};

data test;
length x $20;
x="&a";
run;

proc print data=test; run;
ods listing close;
ods rtf file="~path\report.rtf";
proc report data = test nowindows;
    title &a;
    define x/"name &a" width=20;
run;
ods rtf close;
ods listing;

Does anyone have the suggestion?

Thank you!

 

JC

 

4 REPLIES 4
art297
Opal | Level 21

It will work if you use ods excel. e.g.:

ods excel file="/folders/myfolders/testit.xls" ;
proc print data=want noobs;
run;
ods excel close;

Art, CEO, AnalystFinder.com

 

JohnChen_TW
Quartz | Level 8
It seems unable to work in SAS 9.3...
JohnChen_TW
Quartz | Level 8
Does anyone know why the Greek letters cannot be displayed properly when using proc export to convert an excel file?
ChrisNZ
Tourmaline | Level 20

I doubt proc export has any notion of what an escape character is.

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
  • 4 replies
  • 1137 views
  • 0 likes
  • 3 in conversation