I want to import the data for a three-dimensional parameter p(i,j,k) that is stored in in k excel sheets but GAMS does not let me use dollar control statements in loops. Is there any way to do that using loops or other flow control statements like 'for' or 'while'?
I need to do something like this but it is seemingly impossible:
loop(k,
$call gdxxrw Data.xlsx par=temp rng=k!A1:Z20 rdim=1 cdim=1
$gdxin Data.gdx
$load temp
$gdxin
p(i,j,k)=temp(i,j);
);
Suppose each sheet looks like:
(only difference is I use 2's in sheet2 and 3's in sheet3).
To read this do:
My results are: