BookmarkSubscribeRSS Feed
SASAna
Quartz | Level 8

proc export data=output_xlsd
dbms=xlsx
outfile="&Outdir./XYZ.xlsx"
replace;
run;

 

XYZ.xlsx is not retaining decimal points while exporting (Ex : 0.00 is showing as 0 , 149.00 is showing as 149)

 

I tried to add format in the datastep before exporting. It is not retaining from the dataset . IS there any other way to retain the decimals?

 

Thanks

3 REPLIES 3
Haris
Lapis Lazuli | Level 10

Try ODS EXCEL or the older ODS TAGSETS.EXCELXP rather than PROC EXPORT?  ODS gives you a lot of flexibility with respect to formatting your output.

nketata
Obsidian | Level 7

Few years ago we could write DDE commands to format an Excel sheet from SAS  

 

data _null_;

file DDEcmds;

put '[font.properties("Verdana","Bold",16,,,,,,,3)]';

run;

 

 

It no longer works now. 

Ksharp
Super User
If you have to use PROC EXPORT, you could make a new CHARACTER variable to hold numeric number via put(var,f8.2).

Or you could try ODS EXCEL or ODS TAGSETS.EXCELXP .



ods excel file='/folders/myfolders/x.xlsx';
proc report data=sashelp.class nowd;
define weight/style={tagattr="format:####.00"};
run;
ods excel close;
 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 3 replies
  • 3777 views
  • 0 likes
  • 4 in conversation