Hi, I am trying to round an average to one decimal place without losing the trailing zero if it rounds to a whole number.
For example 8.255 --> 8.3
10.01--->10.0 (instead of 10, which my program is currently outputting)
data x;
set y;
avg=round(average,0.1);
run;
Thank you, any help is much appreciated
Thank you, that worked perfectly!
Is there a way to ensure that this will correctly output to once decimal place in an excel file?
@kmardinian wrote:
Is there a way to ensure that this will correctly output to once decimal place in an excel file?
How are you intending to send data to Excel? Some won't, Proc Export for example, and others basically just set the EXCEL display rule using TAGATTR in one of the report procedures.
I was going to use a proc report ODS statement
ODS _ALL_ CLOSE;
ods excel file = "&outpath.&file..xlsx"
options ( SHEET_NAME="Report"
AUTOFILTER = "all"
EMBEDDED_TITLES ="yes"
ORIENTATION ="landscape"
frozen_headers='3'
absolute_column_width='8, 10, 16, 12'
) ;
proc report data=xx
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.