Data Management
Data Management tips and tricks
Merge a single observation data set to every observation of a multi-observation data set.
proc summary nway data= income;
var yr_income;
output out= avg_income (drop= _type_ _freq_)
mean= avg_yr_income;
run;
* variables _type_ and _freq_ are generated by proc summary *;
data income;
if _N_ = 1 then set avg_income(keep= avg_yr_income);
set income;
run;
** NOTE: This method re-orders the variables in your data set
* such that avg_yr_income will be the first variable. **;
Another topic?


