The SAS Output Delivery System and reporting techniques

Superscript in Excel via Proc Report and AMO?

Reply
Occasional Contributor jb3
Occasional Contributor
Posts: 15

Superscript in Excel via Proc Report and AMO?

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;

 

 

Attachment
Attachment
Frequent Contributor
Posts: 75

Re: Superscript in Excel via Proc Report and AMO?

[ Edited ]

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.

Occasional Contributor jb3
Occasional Contributor
Posts: 15

Re: Superscript in Excel via Proc Report and AMO?

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;

 

Post a Question
Discussion Stats
  • 2 replies
  • 367 views
  • 1 like
  • 2 in conversation