Description
Small Model of Type : GAMS
Category : GAMS Test library
Main file : gdxxrw1.gms
$title 'Testing the clear option with larger data' (GDXXRW1,SEQ=172)
$callTool win32.msappavail Excel
$if errorlevel 1 $abort.noError "No Excel available"
set i / i1*i10 /, i5(i) / i1*i5 /
j / j1*j10 /, j5(j) / j1*j5 /;
parameter a(i,j),b(i,j),a11(i,j),a20(i,j),a02(i,j),c11(i,j),c20(i,j),c02(i,j),d11(i,j),d20(i,j),d02(i,j);
a(i,j) = (ord(i)-1)*card(j) + ord(j);
b(i,j) = 10*a(i,j);
scalar err;
execute 'rm -f temp.xlsx';
execute_unload 'temp.gdx';
execute '=gdxxrw temp.gdx o=temp.xlsx trace=0 par=a rng=one! rdim=1 cdim=1 par=a rng=two! rdim=2 cdim=0 par=a rng=three! rdim=0 cdim=2';
err=errorlevel; display err;
execute '=gdxxrw temp.gdx o=temp.xlsx trace=0 par=b rng=one!a1:F6 clear rdim=1 cdim=1 par=b rng=two!a1:c50 clear rdim=2 cdim=0 par=b rng=three!a1:ax3 clear rdim=0 cdim=2';
err=errorlevel; display err;
execute '=gdxxrw temp.xlsx trace=0 par=a11 rng=one! rdim=1 cdim=1 par=a20 rng=two! rdim=2 cdim=0 par=a02 rng=three! rdim=0 cdim=2';
err=errorlevel; display err;
execute_load 'temp.gdx',a11,a20,a02;
display a11,a20,a02;
c11(i,j) = a(i,j); c11(i5,j5) = b(i5,j5);
c20(i,j) = a(i,j); c20(i5,j ) = b(i5,j );
c02(i,j) = a(i,j); c02(i5,j ) = b(i5,j );
d11(i,j) = a11(i,j) <> c11(i,j);
d20(i,j) = a20(i,j) <> c20(i,j);
d02(i,j) = a02(i,j) <> c02(i,j);
abort$card(d11) d11;
abort$card(d20) d20;
abort$card(d02) d02;