PROC OPTMODEL: equivalent to "ord" for ordered sets

Reply
New Contributor
Posts: 2

PROC OPTMODEL: equivalent to "ord" for ordered sets

Hello,

I was wondering if there is an equivalent operator to "ord", which is common in algebraic modeling languages, such as AIMMS, GAMS and AMPL. I would like to implement constraints but restrict the indices with that operator. Example: "ord(t) > 1". This comes in handy because the set indexed by t can be numeric or contains strings as elements and I don't want to explicitly write something like "t > '1'".

Thank you.

Bruno

Super User
Posts: 11,343

Re: PROC OPTMODEL: equivalent to "ord" for ordered sets

What does this "ord" operation actually mean?

New Contributor
Posts: 2

Re: PROC OPTMODEL: equivalent to "ord" for ordered sets

It returns the order of a particular index. Since OPTMODEL is similar to AMPL, please take a look at section 5.6 in http://www.ampl.com/BOOK/CHAPTERS/08-sets1.pdf. On page 83, you'll see a constraint that uses "ord(t) > 1" and that's exactly what I'd like to do in SAS.

Ask a Question
Discussion stats
  • 2 replies
  • 178 views
  • 0 likes
  • 2 in conversation