Command line Keyword in the gams script

Problems with syntax of GAMS
Post Reply
Jubeyer
User
User
Posts: 32
Joined: 1 year ago

Command line Keyword in the gams script

Post by Jubeyer » 2 months ago

Hi,

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?

Regards,
Jubeyer

Fred
Posts: 266
Joined: 5 years ago

Re: Command line Keyword in the gams script

Post by Fred » 1 month ago

Hi,
please find some commnets below.
Jubeyer wrote:
2 months ago
Hi,

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.
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

Code: Select all

$if not set USE_GAMS $set USE_GAMS YES
You use 'YES' as the default value for the compile time variable.

Jubeyer wrote:
2 months ago
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?
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 hope this helps!

Fred

Post Reply