$title 'Test solveopt option and command line parameter' (solveopt01,SEQ=941) $onText This test is based on the GAMS Model Library model solveopt. Here, we ensure that setting solveopt from the command line behaves the same as setting it through an option statement. Contributor: Lutz Westermann, June 2023 $offText $onEchoV > test.gms Set i / a, b, c / j(i) / b /; Variable obj, x1(i), x2(i), x3(i), x4(i); Equation defobj, e1(i), e2(i), e3(i); defobj.. obj =e= sum(i, x1(i)); e1(i).. x1(i) =g= ord(i) + x4(i)$0; e2(j).. x2(j) =e= 20; e3(i)$0 .. x3(i) =e= ord(i)*10; Model m / all /; m.limCol = 0; m.limRow = 0; x1.up(i) = 10; x2.up(i) = 20; x3.up(i) = 30; x4.up(i) = 40; e1.scale(i) = 10; e2.scale(i) = 20; e3.scale(i) = 30; $ifThen set optionSolveOpt option solveopt = %optionSolveOpt%; $endIf solve m using lp min obj; $offEcho $call.checkErrorLevel gams test.gms lo=%GAMS.lo% --optionSolveOpt=merge gdx=opt $call.checkErrorLevel gams test.gms lo=%GAMS.lo% SolveOpt=merge gdx=clp $call.checkErrorLevel gdxdiff opt.gdx clp.gdx > %system.NullFile% $call.checkErrorLevel gams test.gms lo=%GAMS.lo% --optionSolveOpt=replace gdx=opt $call.checkErrorLevel gams test.gms lo=%GAMS.lo% SolveOpt=replace gdx=clp $call.checkErrorLevel gdxdiff opt.gdx clp.gdx > %system.NullFile% $call.checkErrorLevel gams test.gms lo=%GAMS.lo% --optionSolveOpt=clear gdx=opt $call.checkErrorLevel gams test.gms lo=%GAMS.lo% SolveOpt=clear gdx=clp $call.checkErrorLevel gdxdiff opt.gdx clp.gdx > %system.NullFile%