BookmarkSubscribeRSS Feed
jb3
Obsidian | Level 7 jb3
Obsidian | Level 7

Hi all,

 

I'd like to get data from a SAS stored process to Excel via AMO (Add-in for Microsoft Office), thereby formatting values using superscripts. Using the following code I can get the superscript numbers to html (using ods html), but in Excel the numbers are not superscripted. Any idea how I can get the numbers nicely superscripted into Excel via AMO?

 

Thanks in advance!

Jonas

 

data test;
	set sashelp.cars;
	TypeCyl=cat(strip(Type), '(*ESC*){super ', Cylinders, '}');
run;


proc report data=test;
	col TypeCyl;
	define typeCyl /group;	
run;

proc report data=test;
	col TypeCyl;
	define typeCyl /group across;	
run;

 

 


Html Output.pngExcel Output.png
2 REPLIES 2
ptimusk
Obsidian | Level 7

Please mark this as a solution if it works for you. I am trying to win some conference Swag.

 

I am not sure if this can work for AMO.

 

My method is for ODS. but the style and PROC TEMPLATE may work for you.

 

My paper here has a cheat method

http://support.sas.com/resources/papers/proceedings15/2182-2015.pdf

 

here is the text from the paper.

proc template
define  style styles.mystyle;
parent = styles.default;
style super_up from data / fontsize= 8pt verticalalign=top;
end;
quit;
ods tagsets.excelxp file="&folder output from excelxp, font formatting with proc templatesuperup.xls"
style=mystyle ;
proc print data=sashelp.class;
var name sex; 
var age / style( data )=super_up; run; ods tagsets.excelxp close ;

 This will superscript the variable age.

jb3
Obsidian | Level 7 jb3
Obsidian | Level 7

Hi,

 

This would work if I wanted a whole variable superscripted. Since I need only a superscripted number at the end of a text this does not work. 

 

In the meantime I helped myself out using the unicode numbers for superscripted numbers, as stated here

 

proc format;
	value superZahl
		1='~{unicode 00b9}'
		2='~{unicode 00b2}'
		3='~{unicode 00b3}'
		4='~{unicode 2074}'
		5='~{unicode 2075}'
		6='~{unicode 2076}'
		7='~{unicode 2077}'
		8='~{unicode 2078}'
		9='~{unicode 2079}'
		10='~{unicode 00b9}~{unicode 2070}'
		11='~{unicode 00b9}~{unicode 00b9}'
		12='~{unicode 00b9}~{unicode 00b2}'
		13='~{unicode 00b9}~{unicode 00b3}'
		14='~{unicode 00b9}~{unicode 2074}'
		15='~{unicode 00b9}~{unicode 2075}'
		16='~{unicode 00b9}~{unicode 2076}'
		17='~{unicode 00b9}~{unicode 2077}'
		18='~{unicode 00b9}~{unicode 2078}'
		19='~{unicode 00b9}~{unicode 2079}'
		20='~{unicode 00b2}~{unicode 2070}'
	;
run;

 

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2288 views
  • 1 like
  • 2 in conversation