SalesProfitDB3.gms : Multiple queries in one call

Description

Example database access with MDB2GMS
Multiple queries in one call


Category : GAMS Data Utilities library


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

$ontext

  Example database access with MDB2GMS
  Multiple queries in one call

$offtext

$if %system.filesys% == UNIX $abort.noerror 'This model cannot run on a non-Windows platform';

$onecho > cmd.txt
I=Sample.mdb

Q1=select distinct(year) from data
O1=year.inc

Q2=select distinct(loc) from data
O2=loc.inc

Q3=select distinct(prod) from data
O3=prod.inc

Q4=select prod,loc,year,sales from data
O4=sales.inc

Q5=select prod,loc,year,profit from data
O5=profit.inc
$offecho

$call mdb2gms @cmd.txt > %system.nullfile%

set y years /
$include year.inc
/;
set loc locations /
$include loc.inc
/;
set prd products /
$include prod.inc
/;

parameter sales(prd,loc,y) /
$include sales.inc
/;
display sales;

parameter profit(prd,loc,y) /
$include profit.inc
/;
display profit;