proc means data=sashelp.class noprint; var age; output out=Stats(drop=_FREQ_ _TYPE_) mean=AvgAge; run; data differences_dstep(keep=Name Age AvgAge AgeDiff); if _n_=1 then set Stats; set sashelp.class; AgeDiff=Age-AvgAge; run; proc print data=differences_dstep; title1 "Differences from the average"; run;