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

Hi all,

Hope you all are doing great and stay safe during the pandemic. I would like to combine several "Select" statements where I calculate the average of the variables under one "Proc SQL". Below is the code I use and it works, but I use this code for each variable separately and producing unnecessary files. I want to get the average of other variables like length, age, ... for the same ID under this code. I appreciate your time and help.

1 ACCEPTED SOLUTION
2 REPLIES 2
Reeza
Super User
PROC MEANS is almost always a better option once you're looking at multiple variables, statistics and at different levels.
FYI - your SQL code was not included.

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!

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
  • 858 views
  • 1 like
  • 3 in conversation