SalesProfitDB2m.gms : MDB2GMS Example 2 - Reading a multi valued Table (mute Version)

Description

The programs selects sales and profit information from database "Sample.mdb"
using 'UNION' and writes results to "salesprofitm.inc". It also illustrates
the usage of 'M' (mute) to remove messages to stdout and advertisement in the
generated include file.

This model is referenced in "Example 2 - Reading a multi valued Table" section
"Single Parameter with extra Index Position" (without using the mute option)
from the MDB2GMS Documentation.

Keywords: MDB2GMS, data exchange, GAMS language features


Category : GAMS Data Utilities library


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

$title MDB2GMS Example 2 - Reading a multi valued Table (mute Version) (SalesProfitDB2m,SEQ=035)

$onText
The programs selects sales and profit information from database "Sample.mdb"
using 'UNION' and writes results to "salesprofitm.inc". It also illustrates
the usage of 'M' (mute) to remove messages to stdout and advertisement in the
generated include file.

This model is referenced in "Example 2 - Reading a multi valued Table" section
"Single Parameter with extra Index Position" (without using the mute option)
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
   year 'years'     / 1997*1998 /
   loc  'locations' / nyc, was, la, sfo  /
   prd  'products'  / hardware, software /
   type 'data type' / sales, profit      /;

$onEcho > howToRead.txt
I=Sample.mdb
Q=SELECT year, loc, prod, 'sales', sales FROM data UNION SELECT year, loc, prod, 'profit', profit FROM data
O=salesprofitm.inc
M
$offEcho

$call mdb2gms @howToRead.txt > %system.nullfile%
$ifE errorLevel<>0 $abort Error using MDB2GMS!

Parameter data(year,loc,prd,type) /
$include salesprofitm.inc
/;
display data;