data one;
set sashelp.prdsale;
retain temp;
by region descending salary;
if first.region then
do;
temp=salary;
output;
end;
if last.region then
do;
range=salary-temp;
output;
end;
run;
For each region, what is the number of observation(s) written to the output data set?
答案是2个!为什么呢?retain在这里的作用是什么呢?temp和range是2个不同的变量,怎么就变成了2个观测呢?




雷达卡




京公网安备 11010802022788号







