$ conditionals

Top  Previous  Next

A $ condition is placed in GAMS statements and causes an action to occur if the conditional is true.  The basic $ conditional form is

 

 term$logical condition

 

which says include the item term only if the logical condition is true.  The forms of logical conditions are reviewed below.  For now I will use a conditional that a named item be nonzero for illustration

 

 X$(y gt 0) = 10;

 

In this case the conditional says set X=10 if the scalar y is greater than zero.