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.
Add a blank between super and (a)
mean=' '*sex='Gender Average ^{super (a)}'*(height weight)
I've reported the problem to Tech Support.
Could you use
'Gender Average ^{unicode 23456 }'
find the right number by yourself . Google or check Word's symbol table.
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.
Add a blank between super and (a)
mean=' '*sex='Gender Average ^{super (a)}'*(height weight)
I've reported the problem to Tech Support.
Ah, I should have tried adding a blank in myself.
Thanks Tim.
Much appreciated.
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!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.