User Tools

Site Tools


GDX based tools for binary data exchange

A GDX (GAMS Data Exchange) file is a file that stores the values of one or more GAMS symbols such as sets, parameters variables and equations. GDX files can be used to prepare data for a GAMS model, present results of a GAMS model, store results of the same model using different parameters etc. A GDX file does not store a model formulation or executable statements.

GDX files are binary files that are portable between different platforms. They are written using the byte ordering native to the hardware platform they are created on, but can be read on a platform using a different byte ordering

GDX Tools (platform independent)

GDX files are binary files that are portable between different platforms. Find below a list of tools for GDX files, which are platform independent, included in any GAMS distribution, and maintained by GAMS. For details, please consult the pdf documentation.

  • GDXCOPY: GDXCOPY copies or converts one or more GDX files to a different GDX format.
  • GDXDIFF: GDXDIFF compares the data of symbols with the same name, type and dimension in two GDX files and writes the differences to a third GDX file.
  • GDXDUMP: GDXDUMP writes the contents of a GDX file as a GAMS formatted text file.
  • GDXMERGE:GDXMERGE combines multiple GDX files into one file. Symbols with the same name, dimension and type are combined into a single symbol of a higher dimension. The added dimension has the file name of the combined file as its unique element.
  • GDXRANK: GDXRANK reads one or more one dimensional parameters from a GDX file, sorts each parameter and writes the sorted indices as a one dimensional parameters to the output GDX file.
  • INVERT: INVERT calculates the inverse of a matrix provided as a gdx file.

The WTools

The WTools are a set of MS Windows based tools for data exchange between different applications, which are included in the current GAMS Distribution and are maintained by GAMS. The full documentation and examples can be accessed via the GAMSIDE: Help → Docs → Tools. These tools are designed as interactive Windows programs, but most of them can also be operated through command line parameters. Below we only provide a short overview, for details and examples please consult the documentation:

  • ASK: The ASK utility is a simple tool to ask simple interactive questions to the end-user. For instance, if your model requires a scalar to be changed regularly, instead of letting the end-user change the .gms source file, it may be better to pop up a window, with a question text, where the required number can be entered → Documentation.
  • GDX2ACCESS: GDX2ACCESS is a tool to dump the contents of a GDX file to an MS Access file (.mdb file). Every identifier gets its own table in the .MDB file → Documentation.
  • GDXXRW: GDXXRW allows reading and writing of an Excel spreadsheet. This utility requires the presence of Microsoft Excel and therefore can only be used on a PC running the Windows operating system with Microsoft Excel installed → Documentation.
  • GDXVIEWER: GDXVIEWER is a tool to view and convert data contained in GDX files. Besides inspecting a GDX file, gdxviewer allows you to export to a large number of data formats, including ASCII text, CSV, HTML, XML, database, and spreadsheet formats → Documentation.
  • MDB2GMS: MDB2GMS is a tool to convert data from an Microsoft Access database into GAMS readable format. The source is an MS Access database file (*.MDB) and the target is a GAMS Include File or a GAMS GDX File → Documentation.
  • ShellExecute: ShellExecute is a small wrapper program for the shellexecute Windows API call. It allows you to spawn an external program based on the file type of the document to open → Documentation.
  • SQL2GMS: SQL2GMS is a tool to convert data from an SQL database into GAMS readable format. The source is any data source accessible through Microsoft’s Data Access components including ADO, ODBC and OLEDB. The target is a GAMS Include File or a GAMS GDX File → Documentation.
  • XLS2GMS: XLS2GMS is a tool to convert spreadsheet data from a Microsoft Excel spreadsheet into GAMS readable format. The source is a MS Excel spreadsheet file (*.XLS) and the target is a GAMS Include File → Documentation.

Other GDX (command line) Tools

Please run the tools from the command line or consult the online documentation to get a detailed description:

gdx/gdxtools.txt · Last modified: 2009/07/28 13:43 by interfaces