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;
Register Today!
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.