<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Complex Calculations in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/Complex-Calculations/m-p/8989#M181</link>
    <description>Maybe you could help me with my next problem. I need to manipulate the data generated from the output that you helped with. RMS{i}=21.1 is a code associated with a negative number (i.e. - 2.75). I need to subtract that number from the codes below.&lt;BR /&gt;
&lt;BR /&gt;
Code&lt;BR /&gt;
21.1 = Milling (Always Subtracted)&lt;BR /&gt;
06 = Pavement (Always Added)&lt;BR /&gt;
08 = Pavement (Always Added)&lt;BR /&gt;
40 = Base (Ignored except when below milling)&lt;BR /&gt;
&lt;BR /&gt;
Senario 1&lt;BR /&gt;
Instance Code Depth&lt;BR /&gt;
1 21.1 -2.75 &lt;BR /&gt;
2 08 1.00 2.1=sum(1:2) -1.75&lt;BR /&gt;
3 40 1.00 3.1=sum(2.1:3) -0.75&lt;BR /&gt;
4 06 0.50 4.1=sum(3.1:4) -0.25&lt;BR /&gt;
5 08 0.75 5.1=sum(4.1:5) 0.50&lt;BR /&gt;
6 40 6.00 6.1=sum(5.1:6) 0.50&lt;BR /&gt;
7 08 2.75 7.1=sum(6.1:7) 3.25 &lt;BR /&gt;
&lt;BR /&gt;
Output = 3.50 Total Depth&lt;BR /&gt;
&lt;BR /&gt;
Code So Far&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
DATA MILL1 ;&lt;BR /&gt;
SET MILLA8;&lt;BR /&gt;
BY CNTY SR SEG BEG_OFF;&lt;BR /&gt;
ARRAY DPT{29} LAY_DT1-LAY_DT29;&lt;BR /&gt;
ARRAY PAV{29} PAV_ST1-PAV_ST29;&lt;BR /&gt;
ARRAY RMS{29} RMS_CD1-RMS_CD29;&lt;BR /&gt;
&lt;BR /&gt;
DEPTH=0;&lt;BR /&gt;
CODE=0;&lt;BR /&gt;
flag = 0; * Reset flag;&lt;BR /&gt;
&lt;BR /&gt;
OFF_LEN=END_OFF-BEG_OFF;&lt;BR /&gt;
IF LAY_CD1='BRDK' OR LAY_CD2='BRDK' THEN DELETE;&lt;BR /&gt;
&lt;BR /&gt;
DO I=1 TO 29 BY 1 UNTIL (CODE=21.2);&lt;BR /&gt;
if RMS{i}=21.1 then flag = 1;&lt;BR /&gt;
IF PAV{i} NE 'W' and flag = 1 THEN DO; *Starts processing after flag is set;&lt;BR /&gt;
DEPTH=DPT{i}; CODE=RMS{i};&lt;BR /&gt;
IF CODE=. THEN DELETE;&lt;BR /&gt;
IF CODE=21.2 THEN DEPTH=0;&lt;BR /&gt;
output;&lt;BR /&gt;
END;&lt;BR /&gt;
END;&lt;BR /&gt;
RUN;

Message was edited by: cpjeep</description>
    <pubDate>Fri, 23 Apr 2010 15:12:42 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-04-23T15:12:42Z</dc:date>
    <item>
      <title>Complex Calculations</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/Complex-Calculations/m-p/8989#M181</link>
      <description>Maybe you could help me with my next problem. I need to manipulate the data generated from the output that you helped with. RMS{i}=21.1 is a code associated with a negative number (i.e. - 2.75). I need to subtract that number from the codes below.&lt;BR /&gt;
&lt;BR /&gt;
Code&lt;BR /&gt;
21.1 = Milling (Always Subtracted)&lt;BR /&gt;
06 = Pavement (Always Added)&lt;BR /&gt;
08 = Pavement (Always Added)&lt;BR /&gt;
40 = Base (Ignored except when below milling)&lt;BR /&gt;
&lt;BR /&gt;
Senario 1&lt;BR /&gt;
Instance Code Depth&lt;BR /&gt;
1 21.1 -2.75 &lt;BR /&gt;
2 08 1.00 2.1=sum(1:2) -1.75&lt;BR /&gt;
3 40 1.00 3.1=sum(2.1:3) -0.75&lt;BR /&gt;
4 06 0.50 4.1=sum(3.1:4) -0.25&lt;BR /&gt;
5 08 0.75 5.1=sum(4.1:5) 0.50&lt;BR /&gt;
6 40 6.00 6.1=sum(5.1:6) 0.50&lt;BR /&gt;
7 08 2.75 7.1=sum(6.1:7) 3.25 &lt;BR /&gt;
&lt;BR /&gt;
Output = 3.50 Total Depth&lt;BR /&gt;
&lt;BR /&gt;
Code So Far&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
DATA MILL1 ;&lt;BR /&gt;
SET MILLA8;&lt;BR /&gt;
BY CNTY SR SEG BEG_OFF;&lt;BR /&gt;
ARRAY DPT{29} LAY_DT1-LAY_DT29;&lt;BR /&gt;
ARRAY PAV{29} PAV_ST1-PAV_ST29;&lt;BR /&gt;
ARRAY RMS{29} RMS_CD1-RMS_CD29;&lt;BR /&gt;
&lt;BR /&gt;
DEPTH=0;&lt;BR /&gt;
CODE=0;&lt;BR /&gt;
flag = 0; * Reset flag;&lt;BR /&gt;
&lt;BR /&gt;
OFF_LEN=END_OFF-BEG_OFF;&lt;BR /&gt;
IF LAY_CD1='BRDK' OR LAY_CD2='BRDK' THEN DELETE;&lt;BR /&gt;
&lt;BR /&gt;
DO I=1 TO 29 BY 1 UNTIL (CODE=21.2);&lt;BR /&gt;
if RMS{i}=21.1 then flag = 1;&lt;BR /&gt;
IF PAV{i} NE 'W' and flag = 1 THEN DO; *Starts processing after flag is set;&lt;BR /&gt;
DEPTH=DPT{i}; CODE=RMS{i};&lt;BR /&gt;
IF CODE=. THEN DELETE;&lt;BR /&gt;
IF CODE=21.2 THEN DEPTH=0;&lt;BR /&gt;
output;&lt;BR /&gt;
END;&lt;BR /&gt;
END;&lt;BR /&gt;
RUN;

Message was edited by: cpjeep</description>
      <pubDate>Fri, 23 Apr 2010 15:12:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/Complex-Calculations/m-p/8989#M181</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-04-23T15:12:42Z</dc:date>
    </item>
  </channel>
</rss>

