Page 1 of 1

Call error

Posted: Tue May 23, 2023 11:38 am
by Sudharshan
Hello all,

I am new to GAMS CGE modelling and am trying to run a model by first transferring the SAM Matrix into GAMS as follows:

Parameter SAM ;
$CALL GDXXRW MLI_SAM2018.xlsx Par=SAM rng=D4:DD108
$GDXIN MLI_SAM2018.gdx
$LOAD SAM

But whenever I try to run it, I get the following error: GDXIN failed C:\Users\Sudharshan\Desktop\GCA\GAMS\pep-1-1\pep-1-1\Mali\MLI_SAM2018.gdx
*** Msg: No such file or directory

This is strange because I ran the same script last week and it worked perfectly fine. Any insight is greatly aprreciated!

Re: Call error

Posted: Tue May 23, 2023 12:42 pm
by bussieck
Most likely something with you statement "$CALL GDXXRW MLI_SAM2018.xlsx Par=SAM rng=D4:DD108" went wrong. Check the log for errors. You can also check the return code of gdxxrw for success by actually running "$CALL.checkErrorLevell GDXXRW ...". Perhaps, gdxxrw did not find the Excel file. Hard to say with out more information.

-Michael

Re: Call error

Posted: Tue May 23, 2023 2:28 pm
by Sudharshan
bussieck wrote: 11 months ago Most likely something with you statement "$CALL GDXXRW MLI_SAM2018.xlsx Par=SAM rng=D4:DD108" went wrong. Check the log for errors. You can also check the return code of gdxxrw for success by actually running "$CALL.checkErrorLevell GDXXRW ...". Perhaps, gdxxrw did not find the Excel file. Hard to say with out more information.

-Michael
Hello Michael,

Thank you for your response! I checked the log, but it simply says that I do not have the file or directory, even though I have the required excel file in the same directory. I am not able to run any excel file into GAMS even though I have the file and the name of the file is the same as the on ein the script. Any insight into this is greatly appreciated!

Thanks,
Sud

Re: Call error

Posted: Tue May 23, 2023 11:25 pm
by AndrewC
Could you try the following:

$CALL GDXXRW MLI_SAM2018.xlsx Par=SAM rng=D4:DD108 log=gdxxrw_input_data.log trace=3

This will produce a new file called gdxxrw_input_data.log which might contain additional useful information to help figure this out.

Re: Call error

Posted: Wed May 24, 2023 9:35 am
by Sudharshan
AndrewC wrote: 11 months ago Could you try the following:

$CALL GDXXRW MLI_SAM2018.xlsx Par=SAM rng=D4:DD108 log=gdxxrw_input_data.log trace=3

This will produce a new file called gdxxrw_input_data.log which might contain additional useful information to help figure this out.
Hello, thank you for your response! I copy pasted this sript before my first call code, but i simply says call failed. Please let me know if I can share anything else with you to help me fix this issue!

Re: Call error

Posted: Wed May 24, 2023 11:13 am
by bussieck
Why don't you share the GAMS log and provide access to the Excel workbook but uploading both files to the thread. -Michael

Re: Call error

Posted: Wed May 24, 2023 12:01 pm
by Sudharshan
bussieck wrote: 11 months ago Why don't you share the GAMS log and provide access to the Excel workbook but uploading both files to the thread. -Michael
Hello,

Thank you for your response! Here, I have tried to run the standard pep-1 model that is provided here: https://www.pep-net.org/research-resources/cge-models
PEP-1-1_v2_1.log
(8.2 KiB) Downloaded 47 times
SAM-V2_0.xls
(27.5 KiB) Downloaded 43 times
VAL_PAR.xlsx
(10.75 KiB) Downloaded 37 times
Let me know if you find something!

Thanks,
Sud

Re: Call error

Posted: Wed May 24, 2023 3:32 pm
by bussieck
No good explanations. The call works for me without problems. I can suggest that you try to run GDXXRW from the command line. Open a cmd windows (in the IDE use the MSDOS icon in the right top corner, with Studio use the file context menu and select Open Terminal). Now run "GDXXRW.EXE SAM-V2_0.xls par=SAM rng=SAM!A4:AJ39 Rdim=2 Cdim=2" and see what happens. Perhaps, the virus scanner kicks in or something else happens. Since your license is under M&S you can also just call/email support@gams.com and have them take a look at that. One thing to try: Have you rebooted the machine? Sounds too silly, but it still help now and then.

-Michael