data test;
array x x1-x8;
do i= 1 to 8;
seed = 1000+i;
x(i) = int(rannor(seed)*10);
end;
drop seed i;
run;
data result;
array x x1-x8;
set test;
positive_sum=0;
negative_sum=0;
do i = 1 to dim(x);
if x(i) >0 then positive_sum + x(i);
if x(i) <0 then negative_sum + x(i);
end;
drop i;
run;