BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ABritinAus
Obsidian | Level 7

Hi

Does anyone know how to get superscripts coming out in XLSX files produced using ODS EXCEL?

 

They come out fine using ODS tagsets.excelxp (but we'd like to move to ODS EXCEL as it does certain other things better)

 

I run the following code (using SAS 9.4 maintenance release 3):

 

ods escapechar='^';

ods excel file='c:\temp\test.xlsx'

options(sheet_name="test" embedded_titles="yes" embedded_footnotes="yes" TITLE_FOOTNOTE_NOBREAK="yes");

proc tabulate data=sashelp.class;

var height weight;

class age sex;

table age=' ',

mean=' '*sex='Gender Average ^{super(a)}'*(height weight)

mean='Overall Avg'*(height weight) /

box={label='Age'};

run;

ods excel close;

 

The requested superscripted (a) appears as such in the results (sasreport) window.

 

But in the XLSX file, the (a) doesn't appear at all, with or without superscript.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tim_SAS
Barite | Level 11

Add a blank between super and (a)

 

mean=' '*sex='Gender Average ^{super (a)}'*(height weight)

I've reported the problem to Tech Support.

View solution in original post

4 REPLIES 4
Ksharp
Super User

Could you use 

'Gender Average ^{unicode  23456 }'

 

find the right number by yourself . Google or check Word's symbol table.

ABritinAus
Obsidian | Level 7

Thanks for the suggestion.

 

Unicodes DO seem to work in ODS Excel output.

 

But from what I can see there is a unicode for subscripted a

but not for superscripted a.

 

We need to be able to superscript other letters (not just those with unicodes), and for them to be in parentheses.

 

The unicode parentheses look a bit weird (especially when bold) and probably wouldn't satisfy our publications team, who are used to the "usual" looking superscripting that we can get in ODS tagsets.EXCELXP.

 

Hopefully there is an easier way.

 

But thanks again for the response.

Tim_SAS
Barite | Level 11

Add a blank between super and (a)

 

mean=' '*sex='Gender Average ^{super (a)}'*(height weight)

I've reported the problem to Tech Support.

ABritinAus
Obsidian | Level 7

Ah, I should have tried adding a blank in myself.

 

Thanks Tim.

Much appreciated.

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 2558 views
  • 0 likes
  • 3 in conversation