Data transfer from excel to GAMS using GDXXRW

Problems with syntax of GAMS
Post Reply
nlauffer
User
User
Posts: 2
Joined: 5 years ago

Data transfer from excel to GAMS using GDXXRW

Post 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
Fred
Posts: 372
Joined: 7 years ago

Re: Data transfer from excel to GAMS using GDXXRW

Post 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
nlauffer
User
User
Posts: 2
Joined: 5 years ago

Re: Data transfer from excel to GAMS using GDXXRW

Post by nlauffer »

Thanks a lot !!

Cheers
sunnyd4y
User
User
Posts: 3
Joined: 5 years ago

Re: Data transfer from excel to GAMS using GDXXRW

Post 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.
Post Reply