BookmarkSubscribeRSS Feed
fabdu92
Obsidian | Level 7

Hi,

 

I try to export a table to Excel, with a simple PROC EXPORT.

But some formats are destroyed.

For example I have some amounts values, formats 15.2 in my SAS table, which have, after exporting, 4 decimals in my Excel spreadsheet.  I'm sure you will agree that is a nonsense for amounts...

 

Is there anything I can do to avoid this? Or is it an Excel problem?

 

Thanks for answers.

3 REPLIES 3
naveenraj
Quartz | Level 8

using ODS tagsets.EXCELXP, will give you control over the format of the cells.

eg:
ODS tagsets.ExcelXP
FILE="&out\format.xls";
PROC PRINT DATA=test;
VAR name;
VAR height / STYLE={TAGATTR='format=0.00'};
RUN;
ODS tagsets.ExcelXP CLOSE;

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Proc export won't, this is a feature of Excel trying to be helpful.  If you output to a tagset, Excelxp for example, then you can force formats onto the value use the tagattr option.  However this then creating XML output which may or may not be ok for you.

Reeza
Super User

ODS Excel is a great option if you have SAS 9.4M3

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 3 replies
  • 831 views
  • 0 likes
  • 4 in conversation