Page 1 of 1

Data transfer from excel to GAMS using GDXXRW

Posted: Wed Jun 13, 2018 12:58 pm
by nlauffer
Hello,

I am trying to read in data from an excel sheet to gams, using the following code:

$CALL GDXXRW Typtage_Wind_final_norm_v2.xlsx squeeze=N par=PW rng=Scenarios!P1:AJ673 Cdim=1 Rdim=1 trace=0 par=PWforec rng=Scenarios!F2:G673 Cdim=0 Rdim=1 trace=0
$GDXIN Typtage_Wind_final_norm_v2.gdx
$LOAD PW PWforec
$GDXIN


The following message pops up:
--- call GDXXRW Typtage_Wind_final_norm_v2.xlsx squeeze=N par=PW rng=Scenarios!P1:AJ673 Cdim=1 Rdim=1 trace=0 par=PWforec rng=Scenarios!F2:G673 Cdim=0 Rdim=1 trace=0
--- MA_HRES_final.gms(68) 3 Mb 1 Error
*** above call failed, RC=127
*** ERRORLEVEL set to 1
*** Error 330 in /Applications/GAMS25.1/MA_HRES_final.gms
CALL failed


The excel files do exist, are named exactly like stated in the code, are saved in the same directory / folder as the GAMS-project and the stated range in the worksheet is correct.

I am using GAMS Studio on an OS-X environment. Surprisingly, the code executes on a Windows platform.

Any suggestions?

Thanks a lot in advance.

Cheers,

Noah

Re: Data transfer from excel to GAMS using GDXXRW

Posted: Wed Jun 13, 2018 10:03 pm
by Fred
Noah,

Even though Excel is available on the Mac, it does not support the required Office Automatic (OLE/COM) required by gdxxrw. Hence, gdxxrw is not available on the Mac (see platform/tool availability matrix in our docs: https://www.gams.com/latest/docs/T_MAIN ... _PLATFORMS).
You could either run gdxxrw on Windows and bring the GDX over to the Mac or export the required sheets to CSV files and read these into GAMS (see https://www.gams.com/latest/docs/UG_Dat ... ASCII.html).

I hope this helps!

Fred

Re: Data transfer from excel to GAMS using GDXXRW

Posted: Wed Jun 13, 2018 11:23 pm
by nlauffer
Thanks a lot !!

Cheers

Re: Data transfer from excel to GAMS using GDXXRW

Posted: Fri Jul 27, 2018 12:00 pm
by sunnyd4y
Hi, I'm facing the same issue on both MacOS and Ubuntu. I guess the only solution is to run GAMS on a virtual machine when using these two OS. Isn't it? Would you suggest any other workaround for this problem? Thanks in advance to anyone will reply.