I use proc model for solver.
I want to add conditional restrict statement, i.e for some observation I want to add restrict. Can I do it?
Thank you
Duh, ignore my previous comments. I thought you were talking about PROC TSMODEL.
You can restrict your solution conditionally by using the OPTIMIZE option on the SOLVE statement. Below is an example of a simple case where only the solution for the 9th observation is restricted to be less than or equal to 8. Please let me know if you had something else in mind.
data d; do t=1 to 10; output; end; run; proc model data=d; y = t**2/10; solve y / optimize out=o; restrict ifn(t=9,y,0) <= 8; quit; proc print data=o; run;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.