Repositioning error messages

Top  Previous  Next

It is possible to reposition where the explanation of the errors appears.  In particular, the explanation location can be altered so the error messages appear just below the place the error is found mixed in with the source listing.  This is done by using the option errmsg=1 in the GAMS command line.  This can be imposed in a couple of ways.

One can call GAMS with the command line parameter errmsg=1

 

 gams mymodel errmsg=1

 

 When using the IDE this is placed in the GAMS command box in the upper right hand corner as discussed in the Gamside chapter or if wanted for all models in the file option choice under the execute tab in the box for additional GAMS parameters.

 

One can alter the system level defaults as discussed in the Customizing GAMS chapter by entering this line in the file gmsprm95.txt on basic windows machines.  That file is called gmsprmnt.txt on NT machines and gmsprmun.txt on Unix/Linux machines.  The resultant file looks something like

 

*****************************************************

* GAMS 2.50 Default Parameterfile for Windows NT                 *

* Gams Development Corp.                                         *

* Date : 20 Mar, 1998                                            *

*****************************************************

* entries required by CMEX, put in by gams.exe:

* SYSDIR

* SCRDIR

* SCRIPTNEXT

* INPUT

errmsg=1

ps=9999

optfile=1

 

 In turn, the output looks like the following

 

   6  SET PROCES   PRODUCTION PROCESSES /makechair,maketable,makelamp/

   7      RESOURCE  TYPES OF RESOURCES   /plantcap,salecontrct/;

   8  PARAMETER PRICE(PROCESS)      PRODUCT PRICES BY PROCESS

****                        $120

**** 120  Unknown identifier entered as set

   9                /makechair 6.5 ,maketable 3, makelamp 0.5/

  10          PRODCOST(PROCESS)     COST BY PROCESS

  11                /Makechair 10  ,Maketable 6, Makelamp 1/

****                         $361

**** 361  Values for domain 1 are unknown - no checking possible

  12          RESORAVAIL(RESOURCE)  RESOURCE AVAILABLITY

  13               /plantcap 10 ,salecontrct 3/;

  14  TABLE RESOURUSE(RESOURCE,PROCESS) RESOURCE USAGE

****                                                 $362

**** 362  Values for domain 2 are unknown - no checking possible

  15                     Makechair   Maketable  Makelamp

  16       plantcap         3          2          1.1

  17       salecontrct      1         -1;

  18  POSITIVE VARIABLES PRODUCTION(PROCESS) ITEMS PRODUCED BY PROCESS;

  19  VARIABLES          PROFIT              TOTALPROFIT;

  20  EQUATIONS          OBJT OBJECTIVE FUNCTION ( PROFIT )

  21                     AVAILABLE(RESOURCE) RESOURCES AVAILABLE;

  22  OBJT.. PROFIT=E=   SUM(PROCESS,(PRICE(PROCESS)*yield(process)

****                                                     $140

**** 140  Unknown symbol