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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.