SAS Optimization, and SAS Simulation Studio

turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

04-29-2011 12:48 PM

Hi everyone.

Can someone tell me or direct me to where I can translate the following syntax from a SAS.Com example into English? I can't figure out what this does and cannot find the answer on the SAS website:

(from SAS ... optmodel_sect44.htm)

read data dmnd

into LOC=[loc]

{d in DOW} < demand[loc, d]=col("day"||d) >;

(from SAS ..... Example 8.3 Model Construction)

(especially line#4 ... I found the other lines by searching the SAS website for a few hours..... I estimate that line 4 will take me 2 days to figure out....)

/* load objective data */

read data object nomiss

into [machine customer]

{j in GRADES};

Thank you very very much in advance!!!

JeffGT

Can someone tell me or direct me to where I can translate the following syntax from a SAS.Com example into English? I can't figure out what this does and cannot find the answer on the SAS website:

(from SAS ... optmodel_sect44.htm)

read data dmnd

into LOC=[loc]

{d in DOW} < demand[loc, d]=col("day"||d) >;

(from SAS ..... Example 8.3 Model Construction)

(especially line#4 ... I found the other lines by searching the SAS website for a few hours..... I estimate that line 4 will take me 2 days to figure out....)

/* load objective data */

read data object nomiss

into [machine customer]

{j in GRADES}

Thank you very very much in advance!!!

JeffGT

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-02-2011 08:37 AM

Hello Jeff,

OPTMODEL and the especially the read statement are very powerful tools, unfortunately that goes hand in hand with being not so easy to understand.

First of all, OPTMODEL is an algebraic modeling language, so it creates a mathematical model of an optimization problem and then fill this model with data to create an optimization problem instance. That is a different approach from other SAS procs because modeling in OR is different from modeling in statistics.

I am not sure if all the code you wanted to paste into the forum showed up, the forum has a problem with the "less than or equal" character combination. But the two read statement that show up here (in their full length from the documentation) mean something like this:

1. read the data from the dataset dmnd, store the values of the data set column loc in the set LOC. Then for each of these values in LOC and for each element d in the set DOW, fill the parameter array demand with the according data from the data set.

2. Here machine and customer are variables in the data set that we use to when reading the data, we do not store it in a set as with did with loc in the previous example. It means something like: read machine and customer, then for each j in GRADES, store the data from the appropriate column in the parameter array return. Return is a three dimensional array, so it stores a value for each combination of machine, customer and j.

I hope this helps.

Philipp

OPTMODEL and the especially the read statement are very powerful tools, unfortunately that goes hand in hand with being not so easy to understand.

First of all, OPTMODEL is an algebraic modeling language, so it creates a mathematical model of an optimization problem and then fill this model with data to create an optimization problem instance. That is a different approach from other SAS procs because modeling in OR is different from modeling in statistics.

I am not sure if all the code you wanted to paste into the forum showed up, the forum has a problem with the "less than or equal" character combination. But the two read statement that show up here (in their full length from the documentation) mean something like this:

1. read the data from the dataset dmnd, store the values of the data set column loc in the set LOC. Then for each of these values in LOC and for each element d in the set DOW, fill the parameter array demand with the according data from the data set.

2. Here machine and customer are variables in the data set that we use to when reading the data, we do not store it in a set as with did with loc in the previous example. It means something like: read machine and customer, then for each j in GRADES, store the data from the appropriate column in the parameter array return. Return is a three dimensional array, so it stores a value for each combination of machine, customer and j.

I hope this helps.

Philipp