GDXCOPY

Table of Contents

GDX files from different GAMS version can possibly be incompatible. A current GAMS system can read all older GDX file formats. The GDXCOPY utility provides a mechanism to convert GDX files to a format that different GAMS systems can read.


Usage

gdxcopy option inFile outDir 

or

gdxcopy option -Replace inFile

The first form copies the converted files to a directory; the second form replaces the original file(s).

inFile

Single file or a file pattern with .gdx file extension.

outDir

The output directory.

Instead of converting the files explicitly using the GDXCOPY utility, files can also be converted by using the environment variable GDXCONVERT with values V5, V6 or V7. The values specified will be used together with the value of the environment variable GDXCOMPRESS to call GDXCOPY as soon as a GDX file is created.

The values of the environment variables can also be set using the GAMS parameters GDXCONVERT and GDXCOMPRESS.

Option:

Option Target format
-V5 Version 5
-V6U Version 6 uncompressed
-V6C Version 6 compressed
-V7U Version 7 uncompressed
-V7C Version 7 compressed

A current GAMS system can always handle older GDX file formats. The GDXCOPY utility provides a mechanism to convert GDX files to a prior format, so an older GAMS system can read these files.

Notes:

  • Version 7 formatted files were introduced with version 22.6 of GAMS; version 6 formatted files were introduced with version 22.3 of GAMS. Prior versions used version 5.
  • Some features introduced in version 7 of the GDX file format cannot be represented in older formats.
    Feature Action taken
    Dimension > 10 Symbol is ignored
    Identifier longer than 31 characters Truncated to 31 characters
    Unique element longer than 31 characters Truncated to 31 characters
    Domain of a symbol Domain is ignored
    Aliased symbol Symbol is entered as a set
    Additional text for symbol Additional text is ignored
  • The macOS systems do not support GDX conversion into format version 6 and version 5.


Example

In the example below we convert all GDX files to a compressed format for version 6.

dir
  1,219 t1.gdx
  1,740 t0.gdx
889,973  i.gdx
  1,740 pv.gdx
894,672 bytes
 
gdxcopy -v6c *.gdx newdir
dir newdir
  1,219 t1.gdx
  1,219 t0.gdx
203,316  i.gdx
  1,219 pv.gdx
206,973 bytes