GDXCOPYExample19.gms : Copies a GDX file to a compressed format

Description

Copies UNStatistics.gdx to a compressed format,
creates a new directory called "newdir" in the project directory
and places the new copy there.

Source for GDX file:
   United Nations - Demographic Yearbook, Historical supplement. New York, 1999


Category : GAMS Data Utilities library


Main file : GDXCOPYExample19.gms   includes :  GDXCOPYExample19.gms  UNStatistics.gdx

$onText
   Copies UNStatistics.gdx to a compressed format,
   creates a new directory called "newdir" in the project directory
   and places the new copy there.

   Source for GDX file:
      United Nations - Demographic Yearbook, Historical supplement. New York, 1999
$offText

$echo $declareAndLoad UNStatistics.gdx > "%gams.scrDir%compress.%gams.scrExt%"
$call mkdir newdir > %system.nullFile% 2>&1
$call gams "%gams.scrDir%compress.%gams.scrExt%" writeOutput=0 lo=0 gdxCompress=1 gdx=newdir%system.dirSep%UNStatistics.gdx
$call gdxdump UNStatistics.gdx -v | grep -q "Compression    :    0" > %system.nullFile% 2>&1
$if errorLevel 1 $abort "Expected an uncompressed original GDX file"
$call gdxdump newdir%system.dirSep%UNStatistics.gdx -v | grep -q "Compression    :    1" > %system.nullFile% 2>&1
$if errorLevel 1 $abort "Expected a compressed original GDX file"