proc optmodel; var x{1..10} >= 0; x[10].lb = 1; x[10].ub = 3; x[1].ub = 100; x[2].ub = 200; con x[3] + x[4] = x[6] + x[7], x[6] + x[8] = x[1], x[7] + x[9] = x[2], x[8] + x[9] = x[5]; max f = 9*x[1] + 15*x[2] - 6*x[3] - 16*x[4] - 10*x[5]; save mps nlcexOld; quit; %macro lsompsmod(setold,setnew); data &setnew(drop=i); set &setold; array FC{*} _CHARACTER_; do i=1 to dim(FC); FC[i] = compress(FC[i], "[]"); end; run; %mend; %lsompsmod(nlcexOld, nlcex); proc fcmp outlib=sasuser.myfuncs.mypkg; function nlc1(x1,x6,x8,x10); return (2.5*x1 - x10*x6 - 2*x8); endsub; function nlc2(x2,x7,x9,x10); return (1.5*x2 - x10*x7 - 2*x9); endsub; function nlc3(x3,x4,x10); return (3*x3 + x4 - x10*(x3 + x4)); endsub; run; data condata; input _id_ $ _lb_ _ub_; datalines; nlc1 0 . nlc2 0 . nlc3 0 0 ; options cmplib = sasuser.myfuncs; %let popsize=200; %macro loopSolve(ntimes); proc delete data=pall; %do i=1 %to &ntimes.; %let popsize = %eval(&popsize. + 50*&i.); proc optlso mpsdata = nlcex nlincon = condata logfreq = 1 maxgen=10 popsize=&popsize. seed=0 primalout=pout; performance nthreads=2; run; data pout; set pout; _sol_=&i.; run; proc append base=pall data=pout; run; %end; %mend; %loopSolve(10); proc transpose data=pall out=pallrow (drop=_label_ _name_); by _sol_; var _value_; id _id_; run; proc print data=pallrow; run;