Comparing set elements

Problems with syntax of GAMS
Post Reply
Nikou
User
User
Posts: 33
Joined: 4 years ago

Comparing set elements

Post by Nikou »

Hello everyone

I declare the set

SET i /LA, NY, Dallas, Austin/ ;

Later I would like to make the comparison if (i = "Dallas") then ...

Writing ....$(i = "Dallas") is not correct. What is the correct way to write this?

Thank you
Nikou
User
User
Posts: 33
Joined: 4 years ago

Re: Comparing set elements

Post by Nikou »

You can do this by writing

....$(sameas(i ,'Dallas'))

Key is the operator sameas()
Post Reply