data random;
a=0;
b=1;
seed=0;
do i=1 to 5;
x=a+(b-a)*ranuni(0);
y+x;(y是对x求和)
output;
end;
data tq_y;(提取数据集random的关于y的最后一行的新的一行数据集tq_y)
set random(firstobs=5 obs=5);
keep y;
run;
data kc_y;(把提取出的一行数据集扩充成五行)
set tq_y tq_y tq_y tq_y tq_y;
run;
data random1;(要求的结果)
set random;
set kc_y;
xi=x/y;
sum+xi;
run;
proc print data=random1;
var x y sum xi;
run;