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!
Call error
Re: Call error
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
-Michael
-
- User
- Posts: 4
- Joined: 2 weeks ago
Re: Call error
Hello Michael,bussieck wrote: ↑2 weeks 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
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
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.
$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.
-
- User
- Posts: 4
- Joined: 2 weeks ago
Re: Call error
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
Why don't you share the GAMS log and provide access to the Excel workbook but uploading both files to the thread. -Michael
-
- User
- Posts: 4
- Joined: 2 weeks ago
Re: Call error
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
Let me know if you find something!
Thanks,
Sud
Re: Call error
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
-Michael