In principle you can calculate a lot of different things during a proc sql. But you can't calculate a median because this function is not available. :-(
For a means calculation you would use something like this:
proc sql;
create table summary as
select col1,
col2,
col3
mean(var1) as newcol
from oldtable
group by col1, col2, col3;
quit;