Command line approach

Top  Previous  Next

The basic procedure involved for running command line GAMS is to create a file (nominally myfilename.gms where myfilename is whatever is a legal name on the operating system being used) with a text editor and when done run it with a DOS or UNIX or other operating system command line instruction like

 

GAMS trnsport

 

where trnsport.gms is the file to be run.  Note the gms extension may be omitted and GAMS will still find the file.

The basic command line GAMS call also allows a number of arguments as illustrated below

 

GAMS TRNSPORT pw=80 ps=9999 s=mysave

 

which sets the page width to 80, the page length to 9999 and saves work files.  The full array of possible command line arguments is discussed in the Command Line Parameters chapter.  When GAMS is run the answers are placed in the LST file.  Namely if the input file of GAMS instructions is called myfile.gms then the output will be on myfile.LST.