Hi,
I am working on SAS mathematical programming examples (more precisely ch 7 in https://support.sas.com/documentation/cdl/en/ormpe
Here is a part of the VAR statements:
var IsOpen {MINES, YEARS} binary;
var IsWorked {MINES, YEARS} binary;
var Extract {mine in MINES, YEARS} >= 0 <= extract_ub[mine];
My question is why for the VAR EXTRACT are added the words "mine in", unlike the VARS above it, and how could I know whether I should add such specifications.
Thank you!
The dummy indices are optional in the first two VAR statements. For example, if you prefer you could write the first one as follows:
var IsOpen {mine in MINES, year in YEARS} binary;
The dummy index is required for the third VAR statement because the upper bound extract_ub[mine] depends on it.
The dummy indices are optional in the first two VAR statements. For example, if you prefer you could write the first one as follows:
var IsOpen {mine in MINES, year in YEARS} binary;
The dummy index is required for the third VAR statement because the upper bound extract_ub[mine] depends on it.
So if I understand correctly, on p.83:
num discount {year in YEARS} = 1 / (1 + &discount_rate)^(year - 1);
here we have "year" in YEARS becasue there is also "year" on the RHS, whereas for:
proc optmodel;
set <str> MINES;
num cost {MINES};
num extract_ub {MINES};
num quality {MINES};
read data mine_data into MINES=[mine] cost extract_ub quality;
here for the num cost, extract_ub and quality there is no "mine" in MINES becasue there is no RHS part of an equation where "mine" is specified, but here the values are just being read.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.