Table of Contents

This tool is part of the GAMS Tools Library. Please inspect the general information about GAMS Tools.

This renames the labels in the GDX file using a two dimensional mapSet. The renaming of the labels only affects the string stored for each label, and does not change the data order for the symbols in the GDX file. Because no data is changing in the GDX file, only the strings for the labels are changed and applied to the GDX file directly and no new GDX file is written. This replaces the labels in the GDX file by the ones in the mapSet.


Command line:

gamstool [gdxservice.]GDXRename GDXFile mapSet [reverse=0|1]

Compile time:

$callTool [gdxservice.]GDXRename [-reverse=0|1] GDXFile mapSet

Execution time:

executeTool '[gdxservice.]GDXRename [-reverse=0|1] GDXFile mapSet';


Argument Description
GDXFile Name of GDX file.
mapSet Set of labels to be used for renaming mapSet(*,*).

The following named parameter is available:

Argument Description
reverse=0 or 1 Determines if mapSet with record a.b leads to a replace of a by b or to a replace of b by a (default: 0).


Set c / r, g, b, y /;
Parameter A(c) / r 1, g 2, b 3, y 4 /;
$gdxOut color.gdx
$unload c A

Set map(c,*) /,,, y.yellow /;
$callTool gdxservice.GDXRename color.gdx map

The complete example is also part of the GAMS Test Library, see model [gdxrename1] for reference.