proc sort data=raw.aa;
by stockcode descending date;
run;
data aax;
set raw.aa;
by stockcode descending date;
retain xs;
if first.stockcode then xs=input(tafactor,best.);
if ^missing(close) & ^missing(tafactor) then
nclose=put(round(input(close,best.)*input(tafactor,best.)/xs,0.01),7.2-l);
run;