BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ilikesas
Barite | Level 11

Hi,

 

I am working on SAS mathematical programming examples (more precisely ch 7 in https://support.sas.com/documentation/cdl/en/ormpex/64980/PDF/default/ormpex.pdf) with PROC OPTMODEL.

 

 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!

1 ACCEPTED SOLUTION

Accepted Solutions
RobPratt
SAS Super FREQ

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.

View solution in original post

3 REPLIES 3
RobPratt
SAS Super FREQ

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.

ilikesas
Barite | Level 11

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.

RobPratt
SAS Super FREQ
Yes, that is correct.


sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

Register now!

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