DATA Step, Macro, Functions and more

Proc Means Output In Desired Format

Accepted Solution Solved
Reply
Frequent Contributor
Frequent Contributor
Posts: 83
Accepted Solution

Proc Means Output In Desired Format

I am using PRCO MEANS in SAS 9.2 on 10 different variable so I have defined a macro variable like %let var = BWT GENDER RACE etc ...

 

my following code runs but the value of the variable are coming in informat 12. (example: 69.7597143)

 

proc means N MEAN STD MEDIAN Q1 Q3 MIN MAX data=perflags;
class Group;
var &var ;
output out = STAT (drop = _TYPE_ _FREQ_) ;
run;

 

Is there a way I can format all the variables to say 8.3 by using my macro variable and not specifying all the variables ? For example something like format &var 8.3?


Accepted Solutions
Solution
4 weeks ago
PROC Star
Posts: 1,283

Re: Proc Means Output In Desired Format

You can use MAXDEC=3 to control the number of decimals displayed. 

View solution in original post


All Replies
Solution
4 weeks ago
PROC Star
Posts: 1,283

Re: Proc Means Output In Desired Format

You can use MAXDEC=3 to control the number of decimals displayed. 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 80 views
  • 0 likes
  • 2 in conversation