=

Top  Previous  Next

All replacement (also called assignment) statements in GAMS contain an = sign.  The basic format is (calculate.gms)

 

x=4;

Z(i)=12;

Y(i)$z(i)=z(i);

Q(i)=yes;

 

where the scalar or set dependent item on the left hand side is set equal to the scalar or expression on the right hand side.  The term on the left hand side must always be a single scalar, parameter or set item potentially indexed over sets.  The term can also contain a conditional.  The term on the right hand side is a constant, expression, acronym or special value.