1

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?

Stoner
  • 846
  • 1
  • 10
  • 30

1 Answers1

2

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;
Lutz
  • 2,197
  • 1
  • 10
  • 12