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.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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