Call error

Problems with syntax of GAMS
Post Reply
Sudharshan
User
User
Posts: 4
Joined: 10 months ago

Call error

Post 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!
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Call error

Post 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
Sudharshan
User
User
Posts: 4
Joined: 10 months ago

Re: Call error

Post by Sudharshan »

bussieck wrote: 10 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
AndrewC
User
User
Posts: 17
Joined: 5 years ago

Re: Call error

Post 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.
Sudharshan
User
User
Posts: 4
Joined: 10 months ago

Re: Call error

Post by Sudharshan »

AndrewC wrote: 10 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!
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Call error

Post 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
Sudharshan
User
User
Posts: 4
Joined: 10 months ago

Re: Call error

Post by Sudharshan »

bussieck wrote: 10 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 43 times
SAM-V2_0.xls
(27.5 KiB) Downloaded 38 times
VAL_PAR.xlsx
(10.75 KiB) Downloaded 31 times
Let me know if you find something!

Thanks,
Sud
User avatar
bussieck
Moderator
Moderator
Posts: 1033
Joined: 7 years ago

Re: Call error

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