IndexMapping1.gms : MDB2GMS Example 6 - Index Mapping done in GAMS

Description

This example shows how to map index names if the names in the
database are different from the ones in the GAMS model.

This model is referenced in "Example 6 - Index Mapping" section "Index Mapping
done in GAMS" from the MDB2GMS Documentation.

Keywords: MDB2GMS, data exchange, GAMS language features


Category : GAMS Data Utilities library


Main file : IndexMapping1.gms   includes :  Sample.mdb  IndexMapping1.gms

$title MDB2GMS Example 6 - Index Mapping done in GAMS (IndexMapping1,SEQ=038)

$onText
This example shows how to map index names if the names in the
database are different from the ones in the GAMS model.

This model is referenced in "Example 6 - Index Mapping" section "Index Mapping
done in GAMS" from the MDB2GMS Documentation.

Keywords: MDB2GMS, data exchange, GAMS language features
$offText

$if %system.filesys% == UNIX $abort.noError 'This model cannot run on a non-Windows platform';
$call msappavail -Access
$ifE errorlevel<>0 $abort.noError 'Microsoft Access is not available!';

Set i / NY, DC, LA, SF /;

Set idb 'from database' / 'new york', 'washington dc', 'los angeles', 'san francisco' /;

$call mdb2gms I=Sample.mdb B O="city1.inc" Q="SELECT City, [Value] FROM [example table]" > %system.nullfile%
$ifE errorLevel<>0 $abort Error using MDB2GMS!

Parameter dbdata(idb) /
$include city1.inc
/;

Set mapindx(i,idb) / NY.'new york', DC.'washington dc', LA.'los angeles', SF.'san francisco' /;

Parameter data(i);
data(i) = sum(mapindx(i,idb), dbdata(idb));
display data;