MDBSr5.gms : Sequence of GAMS Models using the save/restart Facility

Description

This program calls a number of GAMS programs. Each program performs one task in the given sequence:
Data extraction --> Data manipulation --> Model definition --> Model solution --> Report writing

This model is referenced in section "Strategies" from the MDB2GMS Documentation.

Keywords: MDB2GMS, data exchange, GAMS language features


Category : GAMS Data Utilities library


Main file : MDBSr5.gms   includes :  MDBSr0.gms  Transportation.mdb  MDBSr5.gms  Sr1.gms  Sr2.gms  Sr3.gms  Sr4.gms

$title Sequence of GAMS Models using the save/restart Facility (MDBSr5,SEQ=041)

$onText
This program calls a number of GAMS programs. Each program performs one task in the given sequence:
Data extraction --> Data manipulation --> Model definition --> Model solution --> Report writing

This model is referenced in section "Strategies" 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!';

*Data extraction
execute '=gams.exe MDBSr0 lo=%GAMS.lo% save=s0';
abort$errorLevel "step 0 failed";

*Data manipulation
execute '=gams.exe Sr1 lo=%GAMS.lo% restart=s0 save=s1';
abort$errorLevel "step 1 failed";

*Model definition
execute '=gams.exe Sr2 lo=%GAMS.lo% restart=s1 save=s2';
abort$errorLevel "step 2 failed";

*Model solution
execute '=gams.exe Sr3 lo=%GAMS.lo% restart=s2 save=s3';
abort$errorLevel "step 3 failed";

*Report writing
execute '=gams.exe Sr4 lo=%GAMS.lo% restart=s3';
abort$errorLevel "step 4 failed";