What is the correct syntax of including the command line keyword in the code?
For example, I am executing this command
gams mycode keep=1 --USE_GAMS=‘YES’
So, how should I write the 'keep=1 --USE_GAMS=‘YES’ ’ in the syntax of the .gms file instead of writing each time in the command line.
My other question is:
What is the correct syntax of a set command in the .gms script.
For example:
In the command prompt I write:
set GMSPYTHONLIB=c:\path\to\python\python38.dll
So, how should I write it inside the .gms script so that I don’t need to set it each time in the command line when I wish to run the script?
keep is a GAMS command line parameter that cannot be set inside the gms file. If you aplways want to keep your scratch directory for all GAMS runs, you could put that command line parameter into your GAMS configuration file.
–USE_GAMS is a double dash parameter that defines a compile time variable. In your gms file you could add
$if not set USE_GAMS $set USE_GAMS YES
You use ‘YES’ as the default value for the compile time variable.
You could use the GAMS configuration file again or your OS’ way to permanently set environment variables. You cannot control the Python lib used for embedded code from within your gms file.
I have a similar question about the correct syntax for passing double dash parameter value from command line to the main program.
For example, I am executing this command
$call gams test_doubledash.gms --month = July
I am passing “July” to the main program. In the main program I have:
$if not set month $set month Jan
if ( %month% = Jan,
Display “Jan”;
elseif %month% = Apr,
Display “Apr”;
elseif %month% = July,
Display “July”;
elseif %month% = Oct,
Display “October”;
);
I am getting unknow symbol error messages for every elseif command line, except July. Any idea where I got it wrong? Thanks for the help in advance! JSS