gdxxrw3.gms : Testing gdxxrw with xlsx or gdx file

Description


Small Model of Type : GAMS


Category : GAMS Test library


Main file : gdxxrw3.gms

$title 'Testing gdxxrw with xlsx or gdx file' (GDXXRW3,SEQ=174)

$callTool win32.msappavail Excel
$if errorlevel 1 $abort.noError "No Excel available"

$onecho > temp.xlsx
this is bad
$offecho

$onecho > temp1.gdx
this is bad
$offecho


set i / i1*i10 /, i5(i) / i1*i5 /
    j / j1*j10 /


parameter a(i,j),err;

execute 'rm -f temp1.xlsx';
execute '=gdxxrw temp1.xlsx trace=0 par=a rng=one! rdim=1 cdim=1';
err=errorlevel; display err;
abort$(not err) 'this should have failed';

execute '=gdxxrw temp.xlsx trace=0 par=a rng=one! rdim=1 cdim=1';
err=errorlevel; display err;
abort$(not err) 'this should have failed';

execute 'rm -f temp.gdx';
execute '=gdxxrw temp.gdx trace=0 par=a rng=one! rdim=1 cdim=1';
err=errorlevel; display err;
abort$(not err) 'this should have failed';

execute '=gdxxrw temp1.gdx trace=0 par=a rng=one! rdim=1 cdim=1';
err=errorlevel; display err;
abort$(not err) 'this should have failed';