Gdxin

Top  Previous  Next

This dollar command is used in a sequence to load specified items from a GDX file.  It is employed using the syntax

 

$Gdxin filename

 

where filename gives the name of the GDX file (with or without the extension GDX) and the command opens the specified GDX file for reading

and

$Gdxin

 

where the command closes the specified GDX file.

The command must be used in conjunction with the command $Load.

Example:

(gdxintrnsport.gms)

$gdxin tran2

$Load

  Sets

       i   canning plants

       j   markets          ;

$Load i j

  Parameters

       a(i)  capacity of plant i in cases

       b(j)  demand at market j in cases;

$Load a=sup

$Load b=dem

  Parameter d(i,j)  distance in thousands of miles;

$Load d

  Scalar f  freight in dollars per case per thousand miles   ;

$Load f

$gdxin

Notes:

A Gdxin command followed by the name of the GDX file to use must precede all $Load commands and opens the file.
A Gdxin command without following arguments must succeed the Load command or commands and closes the file.  More than one Load can appear in between.