data first(rename=(ret=unsquared_ret)); set crsp.msf(keep=permno date ret); squared_ret=ret**2; run;You should also know how to sort datasets and run, say, proc means:

proc sort data=first; by date; run; proc means data=first; by date; var ret; run;

You should know how to redirect output:

proc sort data=first; by date; run; proc means data=first noprint; by date; var ret; output out=sumrets sum(ret)=sum_ret; run;

Andre de Souza 2012-11-19