<?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 Re: AssetMix_Contd_CreateDataStep in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/AssetMix-Contd-CreateDataStep/m-p/821232#M3759</link>
    <description>&lt;P&gt;I think the following two CREATE DATA statements do what you want:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   create data OptMix_RESULTS_box (where=(BoxesNeeded &amp;gt; 0.05)) from
      [ISN=i BOX=b]={i in ISN, b in BOX: &amp;lt;Org_ISN[i],Des_ISN[i],b&amp;gt; in PerBox_Based_Rate_NoZeroes}
      Org=ORG_ISN[i]
      Des=DES_ISN[i]
      ShipmentVolume=Vol_ISN[i]
      ShipmentWeight=Wt_ISN[i]
      BoxesNeeded
      Volume_Capacity[Org_ISN[i],Des_ISN[i],b]
      Wt_Capacity[Org_ISN[i],Des_ISN[i],b]
      BoxBasedCosts=(PerBox_Based_Rate[Org_ISN[i],Des_ISN[i],b] * BoxesNeeded[i,b])
      VolumeUsed=(Volume_Capacity[Org_ISN[i],Des_ISN[i],b] * BoxesNeeded[i,b])
   ;
   create data OptMix_RESULTS_vol (where=(BoxesNeeded &amp;gt; 0.05)) from
      [ISN=i BOX=b]={i in ISN, b in BOX: &amp;lt;Org_ISN[i],Des_ISN[i],b&amp;gt; in PerVol_Based_Rate_NoZeroes}
      Org=ORG_ISN[i]
      Des=DES_ISN[i]
      ShipmentVolume=Vol_ISN[i]
      ShipmentWeight=Wt_ISN[i]
      BoxesNeeded
      Volume_Capacity[Org_ISN[i],Des_ISN[i],b]
      Wt_Capacity[Org_ISN[i],Des_ISN[i],b]
      VolBasedCosts=(PerVol_Based_Rate[Org_ISN[i],Des_ISN[i],b] * BoxesNeeded[i,b])
      VolumeUsed=(Volume_Capacity[Org_ISN[i],Des_ISN[i],b] * BoxesNeeded[i,b])
   ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 Jul 2022 02:49:26 GMT</pubDate>
    <dc:creator>RobPratt</dc:creator>
    <dc:date>2022-07-01T02:49:26Z</dc:date>
    <item>
      <title>AssetMix_Contd_CreateDataStep</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/AssetMix-Contd-CreateDataStep/m-p/821226#M3757</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hi Rob&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;This is the create data step , continued from AssetMixproblem.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;I want to see in my outputs the PerBox Cost and Per Vol costs so that I can play it back to the end user. I understand that for the modeling we have omitted Vol_ISN[i] for PerVolbased costs. This helps to get to the right answer directionally. But when i want to play it back , i want the PerVol based costs to include Vol_ISN[i] in my outputs. Here is what I have in my Create data step at the end of the model. Can you help me to get the right syntax.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;create data CASUSER.OptMix_RESULTS (where=(BoxesNeeded &amp;gt; 0.0000001)) from
[ISN=i BOX=b]
Org=ORG_ISN[i]
Des=DES_ISN[i]
ShipmentVolume=Vol_ISN[i]
ShipmentWeight=Wt_ISN[i]
BoxesNeeded
Volume_Capacity[Org_ISN[i],Des_ISN[i],b]
Wt_Capacity[Org_ISN[i],Des_ISN[i],b]
BoxBasedCosts=(PerBox_Based_Rate[Org_ISN[i],Des_ISN[i],b] * sum (BoxesNeeded [i,b]))
VolBasedCosts=(PerVol_Based_Rate[Org_ISN[i],Des_ISN[i],b] * Vol_ISN*BoxesNeeded[i,b]);
;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The&amp;nbsp;BoxBasedCosts and&amp;nbsp;VolBasedCosts above - I think i did not do it correctly because for BoxBasedCosts, there is no LCL&amp;nbsp; and so how do I specify it inside the create data step to include only those where we have a rate for PerBoxRate, similar to how we declared:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;impvar PerBox_Based_Costs = sum {i in ISN, b in BOX: &amp;lt;Org_ISN[i],Des_ISN[i],b&amp;gt; in PerBox_Based_Rate_NoZeroes}
PerBox_Based_Rate[Org_ISN[i],Des_ISN[i],b] * BoxesNeeded[i,b];&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The same case for PerVol_Based_Costs as well how to do that correctly in create data step.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Another thing that I would like to see in output table, is in this sample shipment that we used ISN='SHA_SEA_10' with 30 Volume, how much volume was stuffed in 20F container and how much volume was stuffed in LCL. This will be useful when I measure utilization of Boxes later on.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 02:20:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/AssetMix-Contd-CreateDataStep/m-p/821226#M3757</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2022-07-01T02:20:13Z</dc:date>
    </item>
    <item>
      <title>Re: AssetMix_Contd_CreateDataStep</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/AssetMix-Contd-CreateDataStep/m-p/821232#M3759</link>
      <description>&lt;P&gt;I think the following two CREATE DATA statements do what you want:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   create data OptMix_RESULTS_box (where=(BoxesNeeded &amp;gt; 0.05)) from
      [ISN=i BOX=b]={i in ISN, b in BOX: &amp;lt;Org_ISN[i],Des_ISN[i],b&amp;gt; in PerBox_Based_Rate_NoZeroes}
      Org=ORG_ISN[i]
      Des=DES_ISN[i]
      ShipmentVolume=Vol_ISN[i]
      ShipmentWeight=Wt_ISN[i]
      BoxesNeeded
      Volume_Capacity[Org_ISN[i],Des_ISN[i],b]
      Wt_Capacity[Org_ISN[i],Des_ISN[i],b]
      BoxBasedCosts=(PerBox_Based_Rate[Org_ISN[i],Des_ISN[i],b] * BoxesNeeded[i,b])
      VolumeUsed=(Volume_Capacity[Org_ISN[i],Des_ISN[i],b] * BoxesNeeded[i,b])
   ;
   create data OptMix_RESULTS_vol (where=(BoxesNeeded &amp;gt; 0.05)) from
      [ISN=i BOX=b]={i in ISN, b in BOX: &amp;lt;Org_ISN[i],Des_ISN[i],b&amp;gt; in PerVol_Based_Rate_NoZeroes}
      Org=ORG_ISN[i]
      Des=DES_ISN[i]
      ShipmentVolume=Vol_ISN[i]
      ShipmentWeight=Wt_ISN[i]
      BoxesNeeded
      Volume_Capacity[Org_ISN[i],Des_ISN[i],b]
      Wt_Capacity[Org_ISN[i],Des_ISN[i],b]
      VolBasedCosts=(PerVol_Based_Rate[Org_ISN[i],Des_ISN[i],b] * BoxesNeeded[i,b])
      VolumeUsed=(Volume_Capacity[Org_ISN[i],Des_ISN[i],b] * BoxesNeeded[i,b])
   ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jul 2022 02:49:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/AssetMix-Contd-CreateDataStep/m-p/821232#M3759</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2022-07-01T02:49:26Z</dc:date>
    </item>
    <item>
      <title>Re: AssetMix_Contd_CreateDataStep</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/AssetMix-Contd-CreateDataStep/m-p/821249#M3760</link>
      <description>&lt;PRE class=""&gt;&lt;CODE&gt;OptMix_RESULTS_vol &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Hi Rob&lt;/P&gt;&lt;P&gt;Thank you. I was thinking of having one table but what you have is great. one for each type. then can i merge them together in 1 table (with box based and vol based sitting in the same column called Costs and Costtype to distinhuis if it is box or vol probably?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE class=""&gt;&lt;CODE&gt;OptMix_RESULTS_box &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jul 2022 05:29:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/AssetMix-Contd-CreateDataStep/m-p/821249#M3760</guid>
      <dc:creator>Santha</dc:creator>
      <dc:date>2022-07-01T05:29:40Z</dc:date>
    </item>
  </channel>
</rss>

