<?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 PROC OPTMODEL no solution no error! &amp;lt;syntex error&amp;gt; in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTMODEL-no-solution-no-error-lt-syntex-error-gt/m-p/351269#M1767</link>
    <description>&lt;P&gt;Hi I'm running PROC OPTMODEL with internal data and data thr' &lt;CODE&gt;read data X into X&lt;/CODE&gt; but after long struggle I'm not able to as SAS is not throwing any error and according to me logic is same for both the methods.&lt;BR /&gt;I'm pasting both code with and without &lt;CODE&gt;read data into&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;plz let me know where i'm making error&lt;/P&gt;&lt;P&gt;data thr &lt;CODE&gt;read data into&lt;/CODE&gt; (This does not works):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;     Data Products;
        input Product $ Demand Ethiopia Tanzania Nigeria;
        datalines;
    Ginko 550 21.00 22.50   23.00
    Kola  450 22.50 24.50   25.50
    ;

    data Locations;
input Location $ Capacity;
datalines;
 Ethiopia 425 
 Tanzania 400
 Nigeria  750 
 ;

  PROC OPTMODEL ;
SET &amp;lt;string&amp;gt; Locations;
SET &amp;lt;string&amp;gt; Products;
number cost{Products, Locations};
number Capacity{Locations};
number Demand{Products};
var Amount{Products, Locations} &amp;gt;= 0;
minimize ProdCost = sum { i in Products} sum {j in Locations} Amount[i,j]*cost[i,j];
con PlantCapacity {j in Locations}  :   sum{i in Products}Amount[i,j] &amp;lt;= Capacity[j];
con ProductDemand {i in Products}   :   sum{j in Locations}Amount[i,j] &amp;gt;= Demand[i];
read data Locations into Locations=[Location] Capacity=Capacity;
read data Products into Products=[Product] Demand = Demand
{j in Locations} &amp;lt; cost[Product, j] = col(j) &amp;gt;;
print ProdCost;
print Amount;   
print cost;
print Capacity;
print Demand;
  QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;data internally read (But this Works):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    proc optmodel;
     set Products = {"Ginko","Kola"};
     set Locations= {"Ethiopia", "Tanzania", "Nigeria"};
     number Costs{Products, Locations} = [
        21.00 22.50     23.00
        22.50 24.50     25.50 ];
     number Capacity{Locations} = [425 400 750];
     number Demand{Products} = [550 450];
     var Amount{Products, Locations} &amp;gt;= 0;
     minimize z = sum{i in Products}sum{j in Locations}Costs[i, j]*Amount[i,j];
     con CapacityC{j in Locations}: sum{i in Products}Amount[i,j] &amp;lt;= Capacity[j];
     con DemandC{i in Products}: sum{j in Locations}Amount[i,j] &amp;gt;= Demand[i];
   solve;
   print Amount z;
   quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 19 Apr 2017 13:04:10 GMT</pubDate>
    <dc:creator>makarand</dc:creator>
    <dc:date>2017-04-19T13:04:10Z</dc:date>
    <item>
      <title>PROC OPTMODEL no solution no error! &lt;syntex error&gt;</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTMODEL-no-solution-no-error-lt-syntex-error-gt/m-p/351269#M1767</link>
      <description>&lt;P&gt;Hi I'm running PROC OPTMODEL with internal data and data thr' &lt;CODE&gt;read data X into X&lt;/CODE&gt; but after long struggle I'm not able to as SAS is not throwing any error and according to me logic is same for both the methods.&lt;BR /&gt;I'm pasting both code with and without &lt;CODE&gt;read data into&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;plz let me know where i'm making error&lt;/P&gt;&lt;P&gt;data thr &lt;CODE&gt;read data into&lt;/CODE&gt; (This does not works):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;     Data Products;
        input Product $ Demand Ethiopia Tanzania Nigeria;
        datalines;
    Ginko 550 21.00 22.50   23.00
    Kola  450 22.50 24.50   25.50
    ;

    data Locations;
input Location $ Capacity;
datalines;
 Ethiopia 425 
 Tanzania 400
 Nigeria  750 
 ;

  PROC OPTMODEL ;
SET &amp;lt;string&amp;gt; Locations;
SET &amp;lt;string&amp;gt; Products;
number cost{Products, Locations};
number Capacity{Locations};
number Demand{Products};
var Amount{Products, Locations} &amp;gt;= 0;
minimize ProdCost = sum { i in Products} sum {j in Locations} Amount[i,j]*cost[i,j];
con PlantCapacity {j in Locations}  :   sum{i in Products}Amount[i,j] &amp;lt;= Capacity[j];
con ProductDemand {i in Products}   :   sum{j in Locations}Amount[i,j] &amp;gt;= Demand[i];
read data Locations into Locations=[Location] Capacity=Capacity;
read data Products into Products=[Product] Demand = Demand
{j in Locations} &amp;lt; cost[Product, j] = col(j) &amp;gt;;
print ProdCost;
print Amount;   
print cost;
print Capacity;
print Demand;
  QUIT;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;data internally read (But this Works):&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;    proc optmodel;
     set Products = {"Ginko","Kola"};
     set Locations= {"Ethiopia", "Tanzania", "Nigeria"};
     number Costs{Products, Locations} = [
        21.00 22.50     23.00
        22.50 24.50     25.50 ];
     number Capacity{Locations} = [425 400 750];
     number Demand{Products} = [550 450];
     var Amount{Products, Locations} &amp;gt;= 0;
     minimize z = sum{i in Products}sum{j in Locations}Costs[i, j]*Amount[i,j];
     con CapacityC{j in Locations}: sum{i in Products}Amount[i,j] &amp;lt;= Capacity[j];
     con DemandC{i in Products}: sum{j in Locations}Amount[i,j] &amp;gt;= Demand[i];
   solve;
   print Amount z;
   quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 19 Apr 2017 13:04:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTMODEL-no-solution-no-error-lt-syntex-error-gt/m-p/351269#M1767</guid>
      <dc:creator>makarand</dc:creator>
      <dc:date>2017-04-19T13:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: PROC OPTMODEL no solution no error! &lt;syntex error&gt;</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTMODEL-no-solution-no-error-lt-syntex-error-gt/m-p/351287#M1768</link>
      <description>&lt;P&gt;Post your log from non working code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 13:28:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTMODEL-no-solution-no-error-lt-syntex-error-gt/m-p/351287#M1768</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-04-19T13:28:38Z</dc:date>
    </item>
    <item>
      <title>Re: PROC OPTMODEL no solution no error! &lt;syntex error&gt;</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTMODEL-no-solution-no-error-lt-syntex-error-gt/m-p/351309#M1769</link>
      <description>&lt;P&gt;Seems fine to me, except that you omitted a SOLVE statement.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Apr 2017 14:04:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTMODEL-no-solution-no-error-lt-syntex-error-gt/m-p/351309#M1769</guid>
      <dc:creator>RobPratt</dc:creator>
      <dc:date>2017-04-19T14:04:12Z</dc:date>
    </item>
    <item>
      <title>Re: PROC OPTMODEL no solution no error! &lt;syntex error&gt;</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTMODEL-no-solution-no-error-lt-syntex-error-gt/m-p/352781#M1779</link>
      <description>Ohh...&lt;BR /&gt;That's a shame</description>
      <pubDate>Mon, 24 Apr 2017 10:43:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/PROC-OPTMODEL-no-solution-no-error-lt-syntex-error-gt/m-p/352781#M1779</guid>
      <dc:creator>makarand</dc:creator>
      <dc:date>2017-04-24T10:43:36Z</dc:date>
    </item>
  </channel>
</rss>

