proc optmodel;
var a >= 0; var b >= 0;
con constr1:
a + b <= 9
max 5*a + 3*b
solve ;
con constr2:
a + b <= 12
max 3*a + 4*b
solve ; (question: how do change the code here, such that this solve only deals with the problem defined after the previous solve?)
quit;
The simplest approach here is to use the DROP statement (SAS/OR(R) 13.2 User's Guide: Mathematical Programming) to drop the first constraint:
drop constr1;
More generally, you can use the PROBLEM and USE PROBLEM statements to handle multiple problems within one PROC OPTMODEL session:
SAS/OR(R) 13.2 User's Guide: Mathematical Programming
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.Register now and lock in 2025 pricing—just $495!
Register now