Please clarify your question. Have you imported an Excel sheet into a SAS dataset and want to calculate the mean age across all rows? Or are you trying to do something else?
Assigning the mean age to another variable is preferable:
proc sql;
create table want as
select *
,mean(age) as mean_age
from have
;
quit;
2025 SAS Hackathon: There is still time!
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!