DATA Step, Macro, Functions and more

Importing an Excel file (.xlsx) containing superscript values into SAS using PROC IMPORT

Accepted Solution Solved
Reply
Frequent Contributor
Posts: 102
Accepted Solution

Importing an Excel file (.xlsx) containing superscript values into SAS using PROC IMPORT

[ Edited ]

Hello Folks,

 

I am trying to check with you to see if there is way I can read an Excel file (.xlsx) in SAS containing few columns with superscripts in the values. Attached is just a sample file containing a single column with some superscript values. I would like the superscripts to be retained when outputting to an Excel or PDF.

 

I  tried  PROC IMPORT, DBMS=XLSX  and running the SAS session in UTF8  encoding but with no luck. In the Output (Excel) the superscript appears not as a superscript but just like regular text beside the value.

 

 

My SAS  version is 9.4M3  on a Linux machine. The Goal is to read the data into a SAS dataset, do some massaging of the data in the dataset and then dump the contents into an Excel or PDF file. Excel version is either 2013 or 2016.

 

Any ideas?  Thanks.


Accepted Solutions
Solution
3 weeks ago
Super User
Posts: 2,519

Re: Importing an Excel file (.xlsx) containing superscript values into SAS using PROC IMPORT

Sorry I can't download MS files. 

 

Is the superscript a font format change, or is it unicode character?

Formats (superscript, bold, etc) aren't kept when importing data. 

 

Try using superscript  ²  U+00B2 Superscript Two Unicode Character (see this page) in Excel to see if it gets imported.

 

View solution in original post


All Replies
Solution
3 weeks ago
Super User
Posts: 2,519

Re: Importing an Excel file (.xlsx) containing superscript values into SAS using PROC IMPORT

Sorry I can't download MS files. 

 

Is the superscript a font format change, or is it unicode character?

Formats (superscript, bold, etc) aren't kept when importing data. 

 

Try using superscript  ²  U+00B2 Superscript Two Unicode Character (see this page) in Excel to see if it gets imported.

 

Frequent Contributor
Posts: 102

Re: Importing an Excel file (.xlsx) containing superscript values into SAS using PROC IMPORT

Thanks @ChrisNZ . The  Superscript is retained when using Unicode characters as opposed to formatting.This i guess is the way to go. 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 106 views
  • 0 likes
  • 2 in conversation