GDX2HAR and HAR2GDX are programs (written originally in 2003 by Mark Horridge in collaboration with Tom Rutherford) which are designed to convert
data between the GAMS GDX and GEMPACK HAR data file formats. Since that time the 2 programs have been been maintained independently (and
diverged!) by GAMS and GEMPACK developers. At the same time the HAR and especially the GDX formats have evolved; an older program may be unable to
read a later input file.
Some people have both GAMS and GEMPACK installed: each installation may have copies of GDX2HAR.EXE and HAR2GDX.EXE. Hence if problems arise it
is necessary to determine WHICH version you are running (ie, which is first on the PATH). In recent Windows versions, you could discover this from
the command prompt by typing:
where gdx2har.exe
In general the GDX2HAR.EXE distributed with GAMS may be better at reading recent-format GDX files, while the HAR2GDX.EXE distributed with
GEMPACK may be better at reading HAR files. Conversely, the GEMPACK-maintained HAR2GDX and the GAMS-maintained GDX2HAR are likely to produce
output files in an older, more widely-compatible format.
In converting GDX to HAR, it may help if you first use the GDXCOPY command to
convert the GDX file to an older GDX format. You might type at the command prompt:
gdxcopy -V5 -Replace infilename.gdx
You can also set up GAMS so that it always writes older-format GDX files; method described here.
ViewHAR can also read and write GDX files: it works the same way as the GEMPACK-maintained versions of GDX2HAR and HAR2GDX.
Recent versions of the GEMPACK-maintained GDX2HAR and HAR2GDX may be found here. They may also be found
in the latest "bundle" downloadable from here (this also includes updated ViewHAR).
The GEMPACK-maintained versions of GDX2HAR, HAR2GDX and ViewHAR all require, and must be distributed with, the file gdxiomh.dll. This also has
evolved over time.