## Problem with error 66. Topic is solved

Problems with syntax of GAMS
BrianLópez
User
Posts: 2
Joined: 8 months ago

### Problem with error 66.

Hello, mi name is Brian and I'm doing the following gams programming.

I've got only two errors, the error 66 in the solve statement and the error 256 in the display statement (I know error 256 is a consecuential error) so I hope you can help me. Thank you very much in advance.
Attachments
Sorgo 1.gms

Renger
Posts: 353
Joined: 2 years ago

### Re: Problem with error 66.

Hi

Your equation AreaMax is not correct:

Code: Select all

``````AreaMax(i)..             AreaMax.up(i)=e=u2(i)*1.5 ;
``````
You define the equation by setting an upper limit for the equation itself. Upper and lower limits only make sense for variables.
Note that even if AreaMax would have been a variable (and the equation had a different name), setting a upper bound for a variable is not done in the equations but before the solve:

Code: Select all

``````AreaMax.up(i) = u2(i) *1.5;
``````
Note furthermore, that it doesn't make sense to write .L and .LO in equations. (e.g., not Depcost.l(l)=e=..., but Depcost(l)=e=...)
Tipp to find an error like you had: Define your model by writing the model not as model /ALL/ but list every equation starting with the objective. Then comment all the equations out with the exception of the objective equation. Run the model: no error => uncomment the next equation and run the model until you run into the error.

Code: Select all

``````
model sorgo /
ACult,
AreaMax,
*             ConsGreat,
*             ConsLow,
*             Production1,
*             Production2,
*             DepCapacity,
*             DepLimith1
*             SorghumDist
*             BioCarbProd
*             TotalCultCt
*             DepCost
*             TransCost
*             Sales
*             Profit
/ ;
``````
Cheers
Renger
____________________________________
Enjoy modeling even more: The lazy economist

BrianLópez
User
Posts: 2
Joined: 8 months ago

### Re: Problem with error 66.

So much thanks to you, I felt a bit embarrassed because I don't know how to code properly since this is my first time. And I'm sorry for keeping you busy with this problem. Have a good day an take care.
-Brian.