Operations Research topics: SAS/OR,
SAS Optimization, and SAS Simulation Studio

Conditional Constarint in proc optmodel

Reply
Learner
Posts: 1

Conditional Constarint in proc optmodel

Hello,

 

I am trying to write a constraint like if product is a then take the type_a column for constraint else take type_b column for product b.
Is it posiible to write a constraint like
con product_limit: if product='a' then something <type_a[i]

else something< type_b;

data commodity;
   input product  type_a type_b; 
   datalines;
a 20  25
a 50  15
a 25  10
b 30  15
b 25  20
b 30  30

;


Thankss!

SAS Employee
Posts: 505

Re: Conditional Constarint in proc optmodel

Posted in reply to ALexandraJ86

Yes, look for "IF-THEN/ELSE expression" in this book of examples.

Ask a Question
Discussion stats
  • 1 reply
  • 163 views
  • 0 likes
  • 2 in conversation