Error in creating GDX File from Excel Data
Posted: Sat Nov 03, 2018 2:11 pm
Hello Experts,
I have a 3-dimensional data in Excel, which looks as follows. (Excel is also attached)
I try to import the data from Excel to GAMS by creating a GDX file by the following code.
However, GAMS doesn't produce the desired results and throw's the following error.
What am I doing wrong? Any help will be highly appreciated!
Regards.
Pradeep
I have a 3-dimensional data in Excel, which looks as follows. (Excel is also attached)
I try to import the data from Excel to GAMS by creating a GDX file by the following code.
Code: Select all
Sets
S 'SupplierS'
K 'Scenarios'
M 'Plants'
Parameters
q11 (S,K,M) 'Transportation cost from supplier,S to plant,M under scenario,S'
$onecho > gdxxrw_in.txt
dset=S rng=Sheet1!A2:A10 rdim=1
dset=K rng=Sheet1!B2:B10 rdim=1
dset=M rng=Sheet1!C1:E1 cdim=1
par=q11 rng=Sheet1!A1:E10 rdim=2 cdim1
$offecho
$CALL GDXXRW.EXE i=data.xlsx o=Try2.gdx @gdxxrw_in.txt
$ife errorlevel<>0 $abort Problems calling GDXXRW
$GDXIN Try2.gdx
$LOAD S,K,M,q11
$GDXIN
Code: Select all
**** 343 Abort triggered by above statement
Regards.
Pradeep