Batch Mode

Top  Previous  Next

Mdb2gms can operate in batch mode.  The basic call is of the form

 

mdb2gms i=Inputdb o=Outputinclude q=Query

 

from a DOS prompt or

 

$call =mdb2gms i=Inputdb o=Outputinclude q=Query

 

from within GAMS where

The = is needed to make GAMS wait as discussed above.
Inputdb is the name of the .MDB Access database file.
Outputinclude is the name of the file where the include file is to be saved.
One needs to use quotes for file names and paths with spaces in them as discussed above.
Query identifies the database SQL query to use.
Queries contain spaces and thus have to be surrounded by double quotes.
The syntax of the SQL queries is not covered here.  Users should refer to the Microsoft Access documentation.
When field names or table names contain blanks, they can be specified in square brackets.
Query examples

 

 Q="select * from mytable"

 Q="select year, production from [production table]"

 Q="select [GAMS City],value from [example table],CityMapper where [Access City]=city"

 

Several other parameters may be used
@filename identifies a file from which to read command line options where within that file each line contains only one option, typed just as if it were specified on the command line.
B causes the program to enclose fields with blanks in quotes as discussed above.
M turns on mute mode as discussed above.
L inserts $offlisting and $onlisting as discussed above.