{"id":2733,"date":"2017-04-28T11:38:14","date_gmt":"2017-04-28T09:38:14","guid":{"rendered":"http:\/\/www.supagro.fr\/wordpress\/modeleco\/?page_id=2733"},"modified":"2019-05-23T10:44:07","modified_gmt":"2019-05-23T08:44:07","slug":"erreurs-courantes-en-gams","status":"publish","type":"page","link":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/complements-utiles\/erreurs-courantes-en-gams\/","title":{"rendered":"Common errors in GAMS"},"content":{"rendered":"<p>The table below lists the most common errors in GAMS. In order to learn how to find an error and correct it, go to lesson 8.<\/p>\n<table width=\"1136\">\n<tbody>\n<tr>\n<td width=\"80\">N\u00b0<\/td>\n<td width=\"445\">Error message<\/td>\n<td width=\"287\">Description<\/td>\n<td width=\"324\">Example (from the Wheat\/Maize farm model)<\/td>\n<\/tr>\n<tr>\n<td width=\"80\">8<\/td>\n<td width=\"445\">Error 8<br \/>\n\u2018)\u2019 expected<\/td>\n<td width=\"287\">&nbsp;<\/td>\n<td width=\"324\">OBJECTIVE..&nbsp; sum(c, mb(c)*X(c) =e= Z ;<\/p>\n<p><em>* ) forgotten in order to close the sum <\/em><\/td>\n<\/tr>\n<tr>\n<td width=\"80\">36<\/td>\n<td width=\"445\">Error 36<br \/>\n\u2018=\u2019 or \u2018..\u2019 or \u2018:=\u2019 or \u2018$=\u2019 operator expected rest of statement ignored<\/td>\n<td width=\"287\">Among other possibilities, the two dots were forgotten after the name of the equation in the attribution.<\/p>\n<p>&nbsp;<\/td>\n<td width=\"324\">OBJECTIVE sum(c, mb(c)*X(c) = Z ;<br \/>\n* (..) omitted after OBJECTIVE<\/td>\n<\/tr>\n<tr>\n<td width=\"80\">37<\/td>\n<td width=\"445\">Error 37<br \/>\n\u2018=l=\u2019 or \u2018=e=\u2019 or \u2018=g=\u2019 operator expected<\/td>\n<td width=\"287\">In GAMS equations, signs are indicated as follows&nbsp;: \u00ab&nbsp;equal&nbsp;\u00bb is written \u00ab&nbsp;=e=&nbsp;\u00bb, \u00ab&nbsp;less than or equal to&nbsp;\u00bb is written \u00ab&nbsp;=l=&nbsp;\u00bb (means lower than) and \u00ab&nbsp;greater than or equal to&nbsp;\u00bb is written \u00ab&nbsp;=g=&nbsp;\u00bb (means&nbsp;greater than)<\/td>\n<td width=\"324\">OBJECTIVE..&nbsp; sum(c, mb(c)*X(c) = Z ;<\/p>\n<p><em>&nbsp;<\/em><em>*instead of =e= we wrote =<\/em><\/td>\n<\/tr>\n<tr>\n<td width=\"80\">71<\/td>\n<td width=\"445\">Error 71<br \/>\nThe symbol shown has been declared as an equation, but no Symbolic equation (..) was found. hint \u2013 look for commas in the Documentation text for the equations. use quotes around the Text or eliminate the commas.<\/td>\n<td width=\"287\">An equation has been declared but has not been attributed.<\/p>\n<p>&nbsp;<\/td>\n<td width=\"324\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"80\">96<\/td>\n<td width=\"445\">Error 96<br \/>\nBlank needed between identifier and text (-or- illegal character in identifier) (-or- check for missing \u2018;\u2019 on previous line<\/td>\n<td width=\"287\">Common error implying that a semi-colon has been omitted.<\/td>\n<td width=\"324\">OBJECTIVE EQUATIONS<\/p>\n<p>objective function<br \/>\nLAND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; soil constraint<br \/>\nLABOUR&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; labour constraint <em>*omission&nbsp;; here OBJECTIVE<\/em>..&nbsp; sum(c, mb(c)*X(c)) =e= Z ;<br \/>\nLAND..&nbsp;&nbsp;&nbsp; sum(c, X(c)) =l= dterre ;<br \/>\nLABOUR..&nbsp; sum(c, bmo(c)*X(c)) =l= dmo ;<\/td>\n<\/tr>\n<tr>\n<td width=\"80\">120<\/td>\n<td width=\"445\">Error 120<br \/>\nUnknown identifier entered as set<\/td>\n<td width=\"287\">When it should have a SET, GAMS reads another identifier<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/td>\n<td width=\"324\">PARAMETER<br \/>\nBMO(V) labour needs per hectare and per crop (hours)<br \/>\n\/wheat&nbsp;&nbsp;&nbsp; 25<br \/>\nmaize&nbsp;&nbsp; 50\/<br \/>\n;<em>*V instead of C in BMO(V)<\/em><\/td>\n<\/tr>\n<tr>\n<td width=\"80\">140<\/td>\n<td width=\"445\">Error 140<br \/>\nUnknown symbol<\/td>\n<td width=\"287\">GAMS does not recognize the symbol used. This may be because you forgot to declare an entity.<\/td>\n<td width=\"324\">&nbsp;<\/td>\n<\/tr>\n<tr>\n<td width=\"80\">160<\/td>\n<td width=\"445\">Error 160<br \/>\nUnique element expected \u2013 a starting symbol was encountered and parsing will continue by entering \u2018element\u2019. An UNQUOTED element has to start with a letter or digit followed by letters, digits, \u2018+\u2019, \u2018-\u2018 or \u2018_\u2019. 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)<\/td>\n<td width=\"287\">One of the elements that you declared does not meet GAMS norms : start with a letter or a number, followed by letters, numbers, \u2018+\u2019, \u2018-\u2018 or \u2018_\u2019 and a maximum of 63 characters. Furthermore, you may not use a reserved word.<\/td>\n<td width=\"324\">SET C crop \/ table, but\/&nbsp;;<\/p>\n<p><em>* the word table was used, which is a WORD RESERVED for the element, instead of wheat<\/em><\/td>\n<\/tr>\n<tr>\n<td width=\"80\">170<\/td>\n<td width=\"445\">Error 170<br \/>\nDomain violation for element<\/td>\n<td width=\"287\">The element does not belong to the domain (in most cases to SET) defined<\/td>\n<td width=\"324\">sets<br \/>\nC crops&nbsp; \/wheat,maize\/<br \/>\n;<br \/>\nparameter<br \/>\nBMO(C)<br \/>\n\/barley&nbsp;&nbsp;&nbsp; 25<br \/>\nmaize&nbsp;&nbsp; 50\/ ;<em>*barley is not an element of C<\/em><\/td>\n<\/tr>\n<tr>\n<td width=\"80\">338<\/td>\n<td width=\"445\">Error 338<br \/>\nUnique element expected \u2013 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, \u2018+\u2019, \u2018-\u2018 or \u2018_\u2019. 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:<br \/>\nABORT, 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)<\/td>\n<td width=\"287\">One of the elements declared does not meet GAMS norms&nbsp;: start with a letter or a number, followed by letters or numbers, \u2018+\u2019, \u2018-\u2018 or \u2018_\u2019 and a maximum of 63 characters. Furthermore, you may not use a reserved word.<\/td>\n<td width=\"324\">SET C crops \/ +wheat, +maize\/&nbsp;;<\/p>\n<p><em>* the name +wheat and +maize was given to the elements instead of wheat and maize<\/em><\/td>\n<\/tr>\n<tr>\n<td width=\"80\">409<\/td>\n<td width=\"445\">Error 409<\/p>\n<p>Unrecognizable item \u2013 skip to find a new statement&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; looking for a \u2018;\u2019 or a key word to get started again<\/td>\n<td width=\"287\">&nbsp;<\/td>\n<td width=\"324\">EQUATIONS<br \/>\nOBJECTIVE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; objective function<br \/>\nLAND&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; soil constraint<br \/>\nLABOUR &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; labour constraint<br \/>\n;<br \/>\nOBJECTIVE..&nbsp; sum(c, mb(c)*X(c)) =e= Z ;<br \/>\nLABOUR..&nbsp; sum(c, bmo(c)*X(c)) =l= dmo ;<br \/>\nLAND..&nbsp;&nbsp;&nbsp; sum(c, X(c)) =l= dterre&nbsp;<em><br \/>\n*omission&nbsp;; here<\/em><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><u>Errors at the end of the model which indicate that resolution has not been successfully carried out :<\/u><\/p>\n<p>Error 256<br \/>\nError(s) in analysing solve statement. More detail appears<br \/>\nBelow the solve statement above<\/p>\n<p>Error 257<br \/>\nSolve statement not checked because of previous errors<\/p>\n","protected":false},"excerpt":{"rendered":"<p>The table below lists the most common errors in GAMS. In order to learn how to find an error and correct it, go to lesson 8. N\u00b0 Error message Description Example (from the Wheat\/Maize farm model) 8 Error 8 \u2018)\u2019 <a class=\"more-link\" href=\"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/complements-utiles\/erreurs-courantes-en-gams\/\">Continue reading <span class=\"screen-reader-text\">  Common errors in GAMS<\/span><span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":92,"featured_media":0,"parent":1119,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-2733","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages\/2733","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/users\/92"}],"replies":[{"embeddable":true,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/comments?post=2733"}],"version-history":[{"count":13,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages\/2733\/revisions"}],"predecessor-version":[{"id":4532,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages\/2733\/revisions\/4532"}],"up":[{"embeddable":true,"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/pages\/1119"}],"wp:attachment":[{"href":"https:\/\/www.supagro.fr\/wordpress\/modelecoen\/wp-json\/wp\/v2\/media?parent=2733"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}