Command line GDX option - GDX dump of the whole problem

Top  Previous  Next

A composite GDX file containing all data items resident at the end of the run of a GAMS code can be created using the command line GDX parameter.  The command line GDX option is invoked by adding the option GDX=filename to the GAMS command line in DOS or Unix/Linux or by including it in the command line parameter box in the IDE.  The basic command line form is

 

gams mymodelname GDX=gdxfilename

 

where

mymodelname specifies the name of the file of GAMS instructions
gdxfilename gives the file name and possible path where the GDX file is to be retained.  When no path is specified the default directory is the current working directory or project directory in the IDE as below.
Setting GDX to the sting "default" ie gdx=default causes GAMS to create aGDX file with the GMS file root name and a GDX extension. Thus gams trnsport gdx=default will cause GAMS to write the reference file trnsport.gdx.

Example:

An example of DOS invocation of the whole problem GDX file for the transport.gms model is given in gamsgdx.bat.  When the IDE is used, the GDX file creation is invoked by an entry in the upper right hand corner of the IDE screen as illustrated below

 

_img65

Notes:

When this option is used the GDX file is created just at the end of the GAMS execution so the data written will contain the current values for all sets, parameters, variables and equations that are on hand at the end of the GAMS job.
The GDX data for the variables and equations contains the levels, marginals, lower bounds, upper bounds and scales for each item.
This yields a file that may be automatically opened in the IDE by doing a mouse click on the highlighted line in the IDE process window.