57 Errors running GAMS sample model

1,374 views
Skip to first unread message

Bryan Arguello

unread,
Oct 17, 2013, 10:39:51 AM10/17/13
to gams...@googlegroups.com
Hi all,

I just installed gams onto my machine and tried running the sample gams program found here: http://www.gams.com/docs/example.htm

I get the following output which I would not expect from a model on the GAMS site:

GAMS 24.1.3  r41464 Released Jul 26, 2013 XXX-DEG Mac x86_64/Darwin                                                                                                                                                                    10/17/13 09:32:51 Page 1
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
C o m p i l a t i o n


   1  {\rtf1\ansi\ansicpg1252\cocoartf1187\cocoasubrtf340
****  $409
   2  {\fonttbl\f0\fmodern\fcharset0 Courier;}
****                                         $408
   3  {\colortbl;\red255\green255\blue255;}
****  $409       $409                     $408
   4  \margl1440\margr1440\vieww21140\viewh12000\viewkind0
****  $409
   5  \deftab720
   6  \pard\pardeftab720
   7   
   8  \f0\fs24 \cf0   SETS\
****                      $2
   9         I   canning plants   / SEATTLE, SAN-DIEGO /\
****                                                    $409
  10         J   markets          / NEW-YORK, CHICAGO, TOPEKA / ;\
****                                                             $409
  11    PARAMETERS\
****              $2
  12         A(I)  capacity of plant i in cases\
  13           /    SEATTLE     350\
****                               $334
  14                SAN-DIEGO   600  /\
****                                  $409
  15         B(J)  demand at market j in cases\
  16           /    NEW-YORK    325\
  17                CHICAGO     300\
  18                TOPEKA      275  / ;\
****                                    $409
  19    TABLE D(I,J)  distance in thousands of miles\
****              $120
  20                      NEW-YORK       CHICAGO      TOPEKA\
****                                                        $338
  21        SEATTLE          2.5           1.7          1.8\
****              $220         $221          $221         $221,338
  22        SAN-DIEGO        2.5           1.8          1.4  ;\
****                $221       $221          $221         $221,338,338
  23    SCALAR F  freight in dollars per case per thousand miles  /90/ ;\
****         $172       $1,225,1,226,1,226,1,225,300
  24    PARAMETER C(I,J)  transport cost in thousands of dollars per case ;\
****                                                                       $409
  25              C(I,J) = F * D(I,J) / 1000 ;\
****                                          $409
  26    VARIABLES\
****             $2
  27         X(I,J)  shipment quantities in cases\
  28         Z       total transportation costs in thousands of dollars ;\
****                                                                     $409
  29    POSITIVE VARIABLE X ;\
****                         $409
  30    EQUATIONS\
****             $2
  31         COST        define objective function\
GAMS 24.1.3  r41464 Released Jul 26, 2013 XXX-DEG Mac x86_64/Darwin                                                                                                                                                                    10/17/13 09:32:51 Page 2
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
C o m p i l a t i o n


  32         SUPPLY(I)   observe supply limit at plant i\
  33         DEMAND(J)   satisfy demand at market j ;\
****                                                 $409
  34    COST ..        Z  =E=  SUM((I,J), C(I,J)*X(I,J)) ;\
****                                                      $409
  35    SUPPLY(I) ..   SUM(J, X(I,J))  =L=  A(I) ;\
****                                              $409
  36    DEMAND(J) ..   SUM(I, X(I,J))  =G=  B(J) ;\
****                                              $409
  37    MODEL TRANSPORT /ALL/ ;\
****                           $409
  38    SOLVE TRANSPORT USING LP MINIMIZING Z ;\
****                                          $257,409
  39  }
GAMS 24.1.3  r41464 Released Jul 26, 2013 XXX-DEG Mac x86_64/Darwin                                                                                                                                                                    10/17/13 09:32:51 Page 3
G e n e r a l   A l g e b r a i c   M o d e l i n g   S y s t e m
Error Messages


  1  Real number expected
  2  Identifier expected
120  Unknown identifier entered as set
172  Element is redefined
220  Partial overlapping column adjusted
221  Total overlapping column ignored
224  Overlapping entry ignored
225  Floating entry ignored
226  Multiple entry ignored
257  Solve statement not checked because of previous errors
300  Remaining errors not printed for this line
334  Illegal data following a data element - rest ignored
338  Unique element expected - symbol was not an element
        and the following text will be skipped until a proper
        symbol is found to recover. Remember that an UNQUOTED
        element has to start with a letter or digit
        followed by letters, digits, '+', '-' or '_'. The length
        is limited to 63 characters. The following words are
        reserved (starting symbols of a GAMS statement) and cannot
        be used for UNQUOTED set elements:
    
           ABORT, ACRONYM(S), ALIAS, BINARY, DISPLAY, ELSE
           EQUATION(S), EXECUTE, FILE(S), FOR, FREE, IF, INTEGER, LOOP
           MODEL(S), NEGATIVE, OPTION(S), PARAMETER(S)
           POSITIVE, PROCEDURE(S), PUT, PUTCLEAR, PUTCLOSE, PUTHD
           PUTPAGE, PUTTL, SCALAR(S), SEMICONT, SET(S), SOS1, SOS2
           TABLE, VARIABLE(S), WHILE
    
        QUOTED elements can contain any character. Single and
        double quotes can be used (starting and ending quote have
        to match).
408  Too many ),] or }
409  Unrecognizable item - skip to find a new statement
       looking for a ';' or a key word to get started again

**** 57 ERROR(S)   0 WARNING(S)


COMPILATION TIME     =        0.003 SECONDS      3 MB  24.1.3 r41464 XXX-DEG


USER: GAMS Development Corporation, Washington, DC   G871201/0000CA-ANY
      Free Demo,  202-342-0180,  sa...@gams.com,  www.gams.com   DC0000


**** FILE SUMMARY

Input      /Users/Test/Desktop/test_gam.gms.rtf
Output     /Users/Test/Desktop/test_gam.gms.lst

**** USER ERROR(S) ENCOUNTERED

Bryan Arguello

unread,
Oct 17, 2013, 11:04:51 AM10/17/13
to gams...@googlegroups.com
And I don't know if it makes a difference, but I chose Gurobi whenever it was available as a choice of optimizer when setting up GAMS.  LINDO was my second choice.

Bryan Arguello

unread,
Oct 17, 2013, 11:23:23 PM10/17/13
to gams...@googlegroups.com
I found my problem.  I put the GAMS code into a gms file through textedit.  Apparently textedit puts in some
undesirable characters.  I created the file through vi instead and it worked.
Reply all
Reply to author
Forward
0 new messages