BookmarkSubscribeRSS Feed
mgrzyb
Quartz | Level 8

HI.  HAPPY NY~~

 

I have a question. 

 

How does one limit the number of digits to the right of the decimal to round to the tenth? 

 

For example:

 


proc means n mean stderr clm min max range data= avisits1;
vars

        var diff_bg          q_pre_gluc       q_post_gluc;
run;

 

 

I only want .Xth rounded.  

 

Thanks. 

5 REPLIES 5
novinosrin
Tourmaline | Level 20

https://documentation.sas.com/?docsetId=proc&docsetTarget=n1qnc9bddfvhzqn105kqitnf29cp.htm&docsetVer... MAXDEC=number specifies the maximum number of decimal places to display the statistics in the printed or displayed output. MAXDEC= has no effect on statistics that are saved in an output data set. Default BEST. width for columnar format, typically about 7. Range 0-8 See Computing Descriptive Statistics with Class Variables Using a CLASSDATA= Data Set with Class Variables

 

 


PROC MEANS DATA=sashelp.class MEAN  MAXDEC=1;
 VAR height;
 run; 
mgrzyb
Quartz | Level 8
Thank you.

I hate to bother you, but is there any way that you could write it out in
code? I have problems reading the SAS documentation. I wish they had
examples b/c that's how most persons learn best.

If you can. If you can't, I will give a try, but I am hopeful.


novinosrin
Tourmaline | Level 20

@mgrzyb wrote:
Thank you.

I hate to bother you, but is there any way that you could write it out in
code?
Not sure i understand what you mean

PROC MEANS DATA=sashelp.class MEAN  MAXDEC=1;
 VAR height weight;
 run; 



 

mgrzyb
Quartz | Level 8
THANK YOU! SOLVED!!!!!!
Reeza
Super User
Please mark the question as solved, with the appropriate solution marked.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 5740 views
  • 0 likes
  • 3 in conversation