Hello,
I am trying to read some parameters from excel to gams. I am creating the gdx. file with this command:
$call gdxxrw.exe Book1.xls par=alpha rng=sheet1!A2:B3 ;
And then I am trying to load the data with:
$gdxin Book1.gdx
$load alpha
$gdxin
As you can see in the attachment the error I am taking says that there is no such file and it is true. Why there is no Book1.gdx file? Can anybody help me please..
GDXXRW issues for a newbie
Re: GDXXRW issues for a newbie
Hi,
Never call an external program without checking the return code:
In your case gdxxrw fails and gives the message "Unknown option =" (from your screenshot). Not clear I understand why that is giving your description of the gdxxrw command. The only thing that looks suspicious is the tailing semicolon ';' at the end of the $call gdxxrw line. GAMS statements are terminated by ';' $call is a compile directive (also called dollar control option, https://www.gams.com/latest/docs/UG_Dol ... DOLLARcall) to call an external program at compile time, not a GAMS statement (https://www.gams.com/latest/docs/UG_GAM ... Statements). If removing the ';' does not help, post your spreadsheet and the part of your GAMS code that does the Excel reading.
-Michael
Never call an external program without checking the return code:
Code: Select all
$call gdxxrw.exe Book1.xls par=alpha rng=sheet1!A2:B3 ;
$if errorlevel 1 $abort problems with running gdxxrw
* Now continue to load GDX data
$gdxin Book1.gdx
$load alpha
-Michael
Re: GDXXRW issues for a newbie
Hello,
I am learning to code in GAMS. I recently came across an issue while linking a gdxrrw file with the code, it is returning this error(placed in attachments along with the corresponding code). I can provide additional information if this is insufficient. Please help me to debug this error. Awaiting a reply.
Thank you in advance.
The error is: The code which produced the error:
I am learning to code in GAMS. I recently came across an issue while linking a gdxrrw file with the code, it is returning this error(placed in attachments along with the corresponding code). I can provide additional information if this is insufficient. Please help me to debug this error. Awaiting a reply.
Thank you in advance.
The error is: The code which produced the error:
-
- User
- Posts: 2
- Joined: 5 years ago
Begginer´s doubt. Please, Help me!!!
I need use a input file with parameters. Is there some syntax that I can put the parameters in a simple file .txt?