BookmarkSubscribeRSS Feed
AlexeyS
Pyrite | Level 9

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

 

 

2 REPLIES 2
mitrov
SAS Employee

Duh, ignore my previous comments. I thought you were talking about PROC TSMODEL. 

kessler
SAS Employee

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;

sas-innovate-white.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.

 

Early bird rate extended! Save $200 when you sign up by March 31.

Register now!

Discussion stats
  • 2 replies
  • 893 views
  • 0 likes
  • 3 in conversation