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

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?

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

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

View solution in original post

1 REPLY 1
PeterClemmensen
Tourmaline | Level 20

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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 1 reply
  • 705 views
  • 0 likes
  • 2 in conversation