Page 1 of 1

GDXXRW issues for a newbie

Posted: Fri Sep 07, 2018 7:36 pm
by polppp
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..

Re: GDXXRW issues for a newbie

Posted: Sat Sep 08, 2018 6:47 am
by bussieck
Hi,

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
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

Re: GDXXRW issues for a newbie

Posted: Sun Dec 23, 2018 1:02 pm
by SekharCT
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 error that is encountered
The error that is encountered
The code which produced the error:
Code which gave the corresponding error
Code which gave the corresponding error

Begginer´s doubt. Please, Help me!!!

Posted: Wed Feb 13, 2019 6:17 pm
by sissi.alves
I need use a input file with parameters. Is there some syntax that I can put the parameters in a simple file .txt?