Hi, Everyone
I am trying to use Proc OPTMODEL as an equation solver and my inputs are from a SAS dataset.
My table looks like this:
OBS X Y
1 10 2
2 20 2
3 30 2
my purpose is to find Z=X/Y which should have Z={5,10,15};
I can only hardcode all this parameter from my input table such as:
Proc OPTMODEL;
var z;
min r = 2*z-10;
constraint z >= 0;
constraint r >= 0;
solve ;
print z;
understand there is a "read data" statement to store the variables into Proc OPTMODEL from dataset but when I was doing this some errors came out. Just would like to understand from you how can i read data from my input table and perform a calculation Z=X/Y for each observation.
Thank you all!
I am trying to use Proc OPTMODEL as an equation solver and my inputs are from a SAS dataset.
My table looks like this:
OBS X Y
1 10 2
2 20 2
3 30 2
my purpose is to find Z=X/Y which should have Z={5,10,15};
I can only hardcode all this parameter from my input table such as:
Proc OPTMODEL;
var z;
min r = 2*z-10;
constraint z >= 0;
constraint r >= 0;
solve ;
print z;
understand there is a "read data" statement to store the variables into Proc OPTMODEL from dataset but when I was doing this some errors came out. Just would like to understand from you how can i read data from my input table and perform a calculation Z=X/Y for each observation.
Thank you all!