10-03-2013 11:35 AM
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'".
10-03-2013 12:29 PM
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.