gdxxrw6.gms : Test for dset reading problem

Description

Contributor: Jan-H. Jagla, November 2010


Small Model of Type : GAMS


Category : GAMS Test library


Main file : gdxxrw6.gms

$title Test for dset reading problem (GDXXRW5,SEQ=502)

$onText
Contributor: Jan-H. Jagla, November 2010
$offText

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

$call rm -f temp.gms temp.xlsx temp.gdx temp2.gdx

* Create the sheet
$onEcho > temp.gms
parameter temp /
i1.j1 1
i1.j2 2
i1.j3 3
i2.j1 4
i2.j2 5
i2.j3 6
/;
execute_unload 'temp.gdx',temp;
execute '=gdxxrw temp.gdx o=temp.xlsx par=temp rng=temp!a1 rdim=2 trace=0';
abort$errorlevel 'gdxxrw: writing failed';
$offEcho

$call gams temp.gms lo=2
$if errorlevel 1 $abort call of temp.gms failed

set i;
$call gdxxrw temp.xlsx o=temp2.gdx dset=i rng=temp!a1 rdim=1 trace=0
$if errorlevel 1 $abort gdxxrw: reading failed
$gdxIn temp2
$load i
display i;