GDXRename

Table of Contents

Note
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.

Usage

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';

Where:

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).

Example

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

Set map(c,*) / r.red, g.green, b.blue, y.yellow /;
$callTool gdxservice.GDXRename color.gdx map

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