data test;
input x y;
cards;
1 2
3 4
8 6
9 5
3 5
6 4
6 1
6 5
;
run;
data test_1;
set test;
array col1(2) a1 a2;
array col2(2) b1 b2;
do i = 1 to 2;
retain col1(i) col2(i);
col1(i)=max(col1(i),x);
col2(i)=max(col2(i),y);
end;
run;
会报错!因为不止2列,所以我想通过数组的方式一次性求出每一列的最大值!