@Ksharp wrote: Therefore, we can find many gem about SAS skill at this forum when we get together.
Of all the very smart things @Ksharp has ever said, this is my favorite.
... View more
proc summary data=compustat nway;
class firm;
var sales;
output out=_stats_ mean=average stddev=std;
run;
data want;
merge compustat _stats_;
by firm;
run;
The data set _stats_ that is created is the one you asked for with one record per firm.
... View more