Debugging error from command line in R

Problems with modeling
Post Reply
Posts: 1
Joined: 2 months ago

Debugging error from command line in R

Post by algoryhmic » 2 months ago

Hi all,

I am attempting to solve a multiple script model using the command line via R.

This model runs without error when run in gamside IDE.

However, when running via the command line with the following commands in R:

Code: Select all

system(paste0('C:\\GAMS\\win64\\24.7\\gams "C:\\GAMS\\win64\\24.7\\Projlib\\[path to model gms]'))
The GDX API loads and runs but there is the following error in the R console part way through:

Code: Select all

gams: **** Error: Parameter error(s)
    :             Reading parameter(s) from "command line"
    :             *** Error Option keyword expected, saw "%"
    :             Finished reading from "command line"

The parameters passed in the model gms as part of the solve scripts call are:

Code: Select all

$set gamsparm "ide=%gams.ide% lo=%gams.lo% errorlog=%gams.errorlog% errmsg=1" 
Any ideas what may cause this, or how I might debug this?

Running GAMS 24.7.3


User avatar
Posts: 198
Joined: 2 years ago

Re: Debugging error from command line in R

Post by bussieck » 2 months ago

I guess something does not work with your gamsparm. The syntax suggests that this is set inside the a GAMS model ($set and the %gams.lo% etc). How does the gamsparm come into play in your setup? From the error message (*** Error Option keyword expected, saw "%") it sounds like that you pass this as part of the command line. The subsitution of %gams.lo% is done by the GAMS compiler and not by the parameter parser, so while you can do lo=2 on the command line, you can't do lo=%gams.lo%.


Post Reply