Maybe you can try this:
Code: Select all
set j /1*20/, i /1*20/;
parameter a /-2/, b(i), x(j);
x(j) = uniform(1,10);
b(i) = Sum ( j$(j.val = i.val - a + 1 and ord(j) GE 2) , x(j));
display b, x;
Code: Select all
set j /1*20/, i /1*20/;
parameter a /-2/, b(i), x(j);
x(j) = uniform(1,10);
b(i) = Sum ( j$(j.val = i.val - a + 1 and ord(j) GE 2) , x(j));
display b, x;