Limiting Decimal Places

By default, PROC MEANS output automatically uses the BESTw. format to display numeric values in the report.

The BESTw. format is the default format that SAS uses for writing numeric values. When there is no format specification, SAS chooses the format that provides the most information about the value according to the available field width. At times, this can result in unnecessary decimal places, making your output hard to read.

     proc means data=clinic.diabetes min max;
     run;

Variable Minimum Maximum
Age
Height
Weight
Pulse
FastGluc
PostGluc
15.0000000
61.0000000
102.0000000
65.0000000
152.0000000
206.0000000
63.0000000
75.0000000
240.0000000
100.0000000
568.0000000
625.0000000


To limit decimal places, use the MAXDEC= option in the PROC MEANS statement, and set it equal to the length that you prefer.


General form, PROC MEANS statement with MAXDEC= option:
PROC MEANS <DATA=SAS-data-set>
<statistic-keyword(s)> MAXDEC=n;

where n specifies the maximum number of decimal places.


     proc means data=clinic.diabetes min max maxdec=0;
     run;

Variable Minimum Maximum
Age
Height
Weight
Pulse
FastGluc
PostGluc
15
61
102
65
152
206
63
75
240
100
568
625