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

Hi,

 

I am running below code

proc means data = p_tra
qntldef=5
mean median min q3 q1 max stddev n ;
var Baseline "Follow-up 1"n "Follow-up 2"n "Follow-up 3"n;
output out=p_tra_out ;
run;

Output:

Variable Mean Median Minimum Upper Quartile Lower Quartile Maximum Std Dev N
Baseline 1.944444 1 1 4 1 5 1.589385 18
Follow-up 1 1.777778 1 1 1 1 5 1.516791 18
Follow-up 2 1.6 1 1 1 1 5 1.298351 15
Follow-up 3 . . . . . . . 0

It is giving me perfect output what I wanted whole displying the output of PROC Means.

But, When I want the same output in output work dataset, I am not getting that.

 Tried of using mean= median=, but no use.
Without specifying any options, I am getting default vars N,Min,Max,Mean,STD. along with them I want Median, Q3, Q1 as well in output dataset.

Could someone tell me how to get output dataset with all variables like proc means output.

 

Thanks,

Pessi

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

Use the STACKODS option and ODS OUTPUT

 

ods output summary=outputdatasetname;
proc means data = sashelp.class stackods qntldef=5 mean median min q3 q1 max stddev n ;
    var height weight;
run;

From now on, please enter code in a code box (as I have done above) by clicking on the "running man" icon and pasting your code into the window that appears.

--
Paige Miller

View solution in original post

2 REPLIES 2
PaigeMiller
Diamond | Level 26

Use the STACKODS option and ODS OUTPUT

 

ods output summary=outputdatasetname;
proc means data = sashelp.class stackods qntldef=5 mean median min q3 q1 max stddev n ;
    var height weight;
run;

From now on, please enter code in a code box (as I have done above) by clicking on the "running man" icon and pasting your code into the window that appears.

--
Paige Miller
pessi
Obsidian | Level 7
@Paige Miller: Thank You. It worked.
Sure. I will do from next time onwords.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 2 replies
  • 2914 views
  • 0 likes
  • 2 in conversation