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.accdb 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
$callTool win32.msappavail Access
$if errorlevel 1 $abort.noError "No Access available"
Set i / NY, DC, LA, SF /;
Set idb 'from database' / 'new york', 'washington dc', 'los angeles', 'san francisco' /;
$call mdb2gms I=Sample.accdb 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;