Reputation: 906
Suppose I have the set ``codes" in GAMS:
SET
codes /aaa, aab, aac, aad, aae/;
How can I then say get the 3rd element (or any element) in the set in GAMS?
Upvotes: 1
Views: 321
Reputation: 2292
Are you looking for the "ord" operator like this?
SET
codes /aaa, aab, aac, aad, aae/
selected(codes);
selected(codes) = ord(codes)=3;
Display selected;
Upvotes: 2