SAS has procedures for optimization. You might want to see if you can use one of those.
Here is a way to just brute force trying multiple values of AIM.
Blow up you data to replicate it for each value of AIM you want to test.
Then perform your summary over the result to get one number per value of AIM.
Not sure what the valid range of vlaues of AIM are or what is a significant change.
You start with trying 1000, 1100, 1200, ...
data per / view=per ;
set AIM_ANALYSIS;
do aim=1000 to 2000 by 100;
per = ifn(Load > AIM,0,(AIM - Load)/Total_CL);
output;
end;
run;
proc sql;
create table Test_Output as
select aim, sum(max_value) as want
from (
select aim,period,max(Per) as Max_value
from per
group by aim,period
)
group by aim
;
quit;
Even making it as a view might cause too much of strain on your system depending how large your analysis dataset is. In that case just run a few at a time.
... View more