Description
The programs selects sales and profit information from database "Sample.accdb" 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.accdb 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.accdb"
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
$callTool win32.msappavail Access
$if errorlevel 1 $abort.noError "No Access 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.accdb
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;