set i /1*10/

variables
         Z
integer variable
         X;

         x.up(i) =1000 ;

Equation
         ObjectiveFunction
         co1(i);

ObjectiveFunction .. Z =e= sum(i,x(i));
co1(i)            .. x(i) =l= 5;


model test1 /all/;
option limcol = 10 , limrow= 20;
option optca=0 , optcr=0;
option sysout=on;
solve test1 using MIP max Z;
display Z.l, X.l;