The sort of formula @Astounding is referring to would work like this:
data testing;
set test2; by measure;
if first.measure then do; n=0; sx=0; sx2=0; end;
if not missing(value) then do;
sx + value;
sx2 + value*value;
n + 1;
if n>1 then std = sqrt((sx2-sx*sx/n)/(n-1));
end;
drop n sx sx2;
run;
... View more