Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- General Programming
- /
- PROC OPTMODEL: equivalent to "ord" for ordered set...

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-03-2013 11:35 AM

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

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

10-03-2013 12:20 PM

What does this "ord" operation actually mean?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

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.