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'?
Let’s make some data as follows:
We can read this as follows:
$set xls d:\tmp\test2.xlsx
The output will look like:
---- 23 PARAMETER a all data
Sheet1 Sheet2 Sheet3
i1.j1 1.000 2.000 3.000
It is quite slow however as we do a call to gdxxrw for each sheet (we usually prefer to read all data into a single GDX file using just one invocation of gdxxrw).