Hi,
I am using excelxp to export a sas dataset to excel file in Unix SAS 9.2. But the excel file can not be opened with error saying style error.
See the attachment. Some of the contents are below.
XML ERROR in Style
REASON: Bad Value
FILE: C:\Users\<userid>\AppData\Local\Temp\scp49188\user1\<userid>\class.xls
GROUP: Style
TAG: Font
ATTRIB: FontName
VALUE: Albany AMT, Helvetica, sans-serif
I can run it correctly in the Unix SAS 9.1.3 and PC SAS 9.1.3 / 9.2. But error happen in Unix SAS 9.2.
And I try another style, such as 'printer', it works. So I am assuming it is due to the style 'sansprinter'.
Can someone help me out? Can excelxp support style 'sansprinter' in Unix SAS 9.2.
Thanks.
The code I use is:
ods listing close;
ods tagsets.excelxp file="class.xls" style=sansprinter;
proc print data=sashelp.class noobs;
run;
ods tagsets.excelxp close;
ods listing;
The problem is because in the Unix SAS 92 the style 'sansprinter' contain the font 'Sans-Serif'. This font is not compatible with MS excel file.
Refer to http://support.sas.com/kb/36/195.html for detail information and workaround.
Hi:
I do not have Unix available to test. When I run the code in SAS 9.3 on Windows, the output opens correctly in Microsoft Office. My suggestion would be that you work with Tech Support on this issue. They can test the code using the same operating system and version of SAS as you have.
cynthia
Hi Cynthia,
Thanks a lot for your answer. Yes, the result is correct in Windows SAS 9.2 in my side.
I will contact the Tech Support for this issue.
The problem is because in the Unix SAS 92 the style 'sansprinter' contain the font 'Sans-Serif'. This font is not compatible with MS excel file.
Refer to http://support.sas.com/kb/36/195.html for detail information and workaround.
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.
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.