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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

Multiple Linear Regression in SAS

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.

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