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;

 

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
  • 2 replies
  • 1653 views
  • 1 like
  • 2 in conversation