BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
chinna0369
Pyrite | Level 9

Hi all, 

 

below is my data:

snip 1.PNG

 

And I am using below code:

proc sort data=adsl(keep=trt01pn age); by trt01pn; run;

proc means data=adsl maxdec=2 noprint;
	by trt01pn;
	var age;
	output out=age_ n=n1 mean=mean1 std=std1 median=med min=min1 max=max1;
run;

Getting below result with missing decimal places, what might be the reason for missing decimal places?

snip 2.PNG

 

How can get values with decimal places?

 

Thanks,

Adithya

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
It's in there, you may need to change the format.
YOu can apply a format in a data step with the format statement.

format var 8.2;

View solution in original post

4 REPLIES 4
ballardw
Super User

I suspect it is a default you have set to view tables.

 

If you print the data you would likely see the decimals for MEAN1 and STD1, the only variables that might have a decimal.

Or you may need to provide an explicit format when printing.

 

Why bother with the MAXDEC=2 when using NOPRINT? From the documentation for Proc Means:

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.

chinna0369
Pyrite | Level 9

Yes, how I can I get decimal places to my output dataset? where can I change that setting?

Reeza
Super User
It's in there, you may need to change the format.
YOu can apply a format in a data step with the format statement.

format var 8.2;
chinna0369
Pyrite | Level 9

Got it. Thanks! 

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 1052 views
  • 2 likes
  • 3 in conversation