<?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 SPARSEDATA format with three (row, coeff) pairs in Mathematical Optimization, Discrete-Event Simulation, and OR</title>
    <link>https://communities.sas.com/t5/Mathematical-Optimization/SPARSEDATA-format-with-three-row-coeff-pairs/m-p/35314#M334</link>
    <description>I use PROC LP with sparsedata input. Is there a known problem with sparsedata with THREE pairs of (row, coeff) in one data row&lt;BR /&gt;
or did I miss something? &lt;BR /&gt;
&lt;BR /&gt;
The input data looks as follows:&lt;BR /&gt;
&lt;BR /&gt;
data GASOPT;&lt;BR /&gt;
  Format _TYPE_ $8. _COL_ $25. _ROW1_ $28. _COEF1_ comma12. _ROW2_ $7. _COEF2_ comma11. _ROW3_ $7. _COEF3_ comma9.4 ;&lt;BR /&gt;
  Input _TYPE_ _COL_ _ROW1_ _COEF1_ _ROW2_ _COEF2_ _ROW3_ _COEF3_ ;&lt;BR /&gt;
datalines;&lt;BR /&gt;
...&lt;BR /&gt;
.       75300202_80502__T_0183   LOWER                       0           UPPER  9876543210 XP     4.052    &lt;BR /&gt;
.       75300202_80502__T_0184   LOWER                       0           UPPER  9876543210 XP     4.052    &lt;BR /&gt;
...&lt;BR /&gt;
GE      .                        EQ_LOW_M_75300202_183       .           .      .          .      .        &lt;BR /&gt;
.       _RHS_                    EQ_LOW_M_75300202_183       3000000     .      .          .      .        &lt;BR /&gt;
.       75300202_80502__T_0183   EQ_LOW_M_75300202_183       1           .      .          .      .        &lt;BR /&gt;
.       75300202_80502__T_0184   EQ_LOW_M_75300202_183       1           .      .          .      .        &lt;BR /&gt;
...&lt;BR /&gt;
GE      .                        EQ_LOW_M_157790202_183      .           .      .          .      .        &lt;BR /&gt;
.       _RHS_                    EQ_LOW_M_157790202_183      10000000    .      .          .      .        &lt;BR /&gt;
.       157790202_80502__T_0183  EQ_LOW_M_157790202_183      1           .      .          .      .        &lt;BR /&gt;
&lt;BR /&gt;
Loading the data works fine -- I see the data correctly with VIEWTABLE.&lt;BR /&gt;
&lt;BR /&gt;
Trying to run the program gives the following ERROR messages:&lt;BR /&gt;
ERROR: The coefficient in row EQ_LOW_M and column _RHS_ is defined to be 3000000 and 10000000.&lt;BR /&gt;
ERROR: The coefficient in row EQ_UPP_M and column _RHS_ is defined to be 3000000 and 17000000.&lt;BR /&gt;
ERROR: The coefficient in row EQ_LOW_G and column _RHS_ is defined to be 39000000 and 120000000.&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
I looks as if the names in _ROW1_ (e.g. EQ_LOW_M_75300202_183) are only interpreted with the FIRST 8 CHARACTERS. This does only happen, &lt;BR /&gt;
when we use SAS interactively with data from files. We use the sparsedata format as above for years now, but read the problem from oracle&lt;BR /&gt;
with the sql statement:&lt;BR /&gt;
  create table model as select &lt;BR /&gt;
     type as _type_, col as _col_, row1 as _row1_, coef1 as _coef1_, &lt;BR /&gt;
     row2 as _row2_, coef2 as _coef2_, row3 as _row3_, coef3 as _coef3_&lt;BR /&gt;
     from GASOPT.opt_sparsedata where variante_id = &amp;amp;Variante;   &lt;BR /&gt;
&lt;BR /&gt;
There is no problem at all, if I use the "standard" sparsedata format interactively:&lt;BR /&gt;
&lt;BR /&gt;
data GASOPT;&lt;BR /&gt;
  Format _TYPE_ $8. _COL_ $25. _ROW_ $28. _COEFF_ comma12.4;&lt;BR /&gt;
  Input _TYPE_  _COL_  _ROW_  _COEFF_;&lt;BR /&gt;
datalines;&lt;BR /&gt;
...&lt;BR /&gt;
.       75300202_80502__T_0183   LOWER                       0           &lt;BR /&gt;
.       75300202_80502__T_0183   UPPER                       9876543210  &lt;BR /&gt;
.       75300202_80502__T_0183   XP                          4.052       &lt;BR /&gt;
.       75300202_80502__T_0184   LOWER                       0           &lt;BR /&gt;
.       75300202_80502__T_0184   UPPER                       9876543210  &lt;BR /&gt;
.       75300202_80502__T_0184   XP                          4.052       &lt;BR /&gt;
...&lt;BR /&gt;
GE      .                        EQ_LOW_M_75300202_183       .           &lt;BR /&gt;
.       _RHS_                    EQ_LOW_M_75300202_183       3000000     &lt;BR /&gt;
.       75300202_80502__T_0183   EQ_LOW_M_75300202_183       1           &lt;BR /&gt;
.       75300202_80502__T_0184   EQ_LOW_M_75300202_183       1           &lt;BR /&gt;
...&lt;BR /&gt;
GE      .                        EQ_LOW_M_157790202_183      .           &lt;BR /&gt;
.       _RHS_                    EQ_LOW_M_157790202_183      10000000    &lt;BR /&gt;
.       157790202_80502__T_0183  EQ_LOW_M_157790202_183      1           &lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
    <pubDate>Mon, 14 Jun 2010 14:27:49 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2010-06-14T14:27:49Z</dc:date>
    <item>
      <title>SPARSEDATA format with three (row, coeff) pairs</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SPARSEDATA-format-with-three-row-coeff-pairs/m-p/35314#M334</link>
      <description>I use PROC LP with sparsedata input. Is there a known problem with sparsedata with THREE pairs of (row, coeff) in one data row&lt;BR /&gt;
or did I miss something? &lt;BR /&gt;
&lt;BR /&gt;
The input data looks as follows:&lt;BR /&gt;
&lt;BR /&gt;
data GASOPT;&lt;BR /&gt;
  Format _TYPE_ $8. _COL_ $25. _ROW1_ $28. _COEF1_ comma12. _ROW2_ $7. _COEF2_ comma11. _ROW3_ $7. _COEF3_ comma9.4 ;&lt;BR /&gt;
  Input _TYPE_ _COL_ _ROW1_ _COEF1_ _ROW2_ _COEF2_ _ROW3_ _COEF3_ ;&lt;BR /&gt;
datalines;&lt;BR /&gt;
...&lt;BR /&gt;
.       75300202_80502__T_0183   LOWER                       0           UPPER  9876543210 XP     4.052    &lt;BR /&gt;
.       75300202_80502__T_0184   LOWER                       0           UPPER  9876543210 XP     4.052    &lt;BR /&gt;
...&lt;BR /&gt;
GE      .                        EQ_LOW_M_75300202_183       .           .      .          .      .        &lt;BR /&gt;
.       _RHS_                    EQ_LOW_M_75300202_183       3000000     .      .          .      .        &lt;BR /&gt;
.       75300202_80502__T_0183   EQ_LOW_M_75300202_183       1           .      .          .      .        &lt;BR /&gt;
.       75300202_80502__T_0184   EQ_LOW_M_75300202_183       1           .      .          .      .        &lt;BR /&gt;
...&lt;BR /&gt;
GE      .                        EQ_LOW_M_157790202_183      .           .      .          .      .        &lt;BR /&gt;
.       _RHS_                    EQ_LOW_M_157790202_183      10000000    .      .          .      .        &lt;BR /&gt;
.       157790202_80502__T_0183  EQ_LOW_M_157790202_183      1           .      .          .      .        &lt;BR /&gt;
&lt;BR /&gt;
Loading the data works fine -- I see the data correctly with VIEWTABLE.&lt;BR /&gt;
&lt;BR /&gt;
Trying to run the program gives the following ERROR messages:&lt;BR /&gt;
ERROR: The coefficient in row EQ_LOW_M and column _RHS_ is defined to be 3000000 and 10000000.&lt;BR /&gt;
ERROR: The coefficient in row EQ_UPP_M and column _RHS_ is defined to be 3000000 and 17000000.&lt;BR /&gt;
ERROR: The coefficient in row EQ_LOW_G and column _RHS_ is defined to be 39000000 and 120000000.&lt;BR /&gt;
...&lt;BR /&gt;
&lt;BR /&gt;
I looks as if the names in _ROW1_ (e.g. EQ_LOW_M_75300202_183) are only interpreted with the FIRST 8 CHARACTERS. This does only happen, &lt;BR /&gt;
when we use SAS interactively with data from files. We use the sparsedata format as above for years now, but read the problem from oracle&lt;BR /&gt;
with the sql statement:&lt;BR /&gt;
  create table model as select &lt;BR /&gt;
     type as _type_, col as _col_, row1 as _row1_, coef1 as _coef1_, &lt;BR /&gt;
     row2 as _row2_, coef2 as _coef2_, row3 as _row3_, coef3 as _coef3_&lt;BR /&gt;
     from GASOPT.opt_sparsedata where variante_id = &amp;amp;Variante;   &lt;BR /&gt;
&lt;BR /&gt;
There is no problem at all, if I use the "standard" sparsedata format interactively:&lt;BR /&gt;
&lt;BR /&gt;
data GASOPT;&lt;BR /&gt;
  Format _TYPE_ $8. _COL_ $25. _ROW_ $28. _COEFF_ comma12.4;&lt;BR /&gt;
  Input _TYPE_  _COL_  _ROW_  _COEFF_;&lt;BR /&gt;
datalines;&lt;BR /&gt;
...&lt;BR /&gt;
.       75300202_80502__T_0183   LOWER                       0           &lt;BR /&gt;
.       75300202_80502__T_0183   UPPER                       9876543210  &lt;BR /&gt;
.       75300202_80502__T_0183   XP                          4.052       &lt;BR /&gt;
.       75300202_80502__T_0184   LOWER                       0           &lt;BR /&gt;
.       75300202_80502__T_0184   UPPER                       9876543210  &lt;BR /&gt;
.       75300202_80502__T_0184   XP                          4.052       &lt;BR /&gt;
...&lt;BR /&gt;
GE      .                        EQ_LOW_M_75300202_183       .           &lt;BR /&gt;
.       _RHS_                    EQ_LOW_M_75300202_183       3000000     &lt;BR /&gt;
.       75300202_80502__T_0183   EQ_LOW_M_75300202_183       1           &lt;BR /&gt;
.       75300202_80502__T_0184   EQ_LOW_M_75300202_183       1           &lt;BR /&gt;
...&lt;BR /&gt;
GE      .                        EQ_LOW_M_157790202_183      .           &lt;BR /&gt;
.       _RHS_                    EQ_LOW_M_157790202_183      10000000    &lt;BR /&gt;
.       157790202_80502__T_0183  EQ_LOW_M_157790202_183      1           &lt;BR /&gt;
&lt;BR /&gt;
Thanks!</description>
      <pubDate>Mon, 14 Jun 2010 14:27:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SPARSEDATA-format-with-three-row-coeff-pairs/m-p/35314#M334</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-14T14:27:49Z</dc:date>
    </item>
    <item>
      <title>Re: SPARSEDATA format with three (row, coeff) pairs</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SPARSEDATA-format-with-three-row-coeff-pairs/m-p/35315#M335</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
The problem might be that in the format you read _ROW2_ and _ROW3_ with $7.. Try changing it to $28. Maybe LP uses the smallest or the last row variable size. You can enter a Tech Support request to have it further investigated.&lt;BR /&gt;
&lt;BR /&gt;
By the way, OPTMODEL and OPTLP/OPTMILP are much more powerful and more modern procs for doing mathematical programming.&lt;BR /&gt;
&lt;BR /&gt;
Philipp</description>
      <pubDate>Tue, 15 Jun 2010 20:07:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SPARSEDATA-format-with-three-row-coeff-pairs/m-p/35315#M335</guid>
      <dc:creator>Philipp_SAS</dc:creator>
      <dc:date>2010-06-15T20:07:10Z</dc:date>
    </item>
    <item>
      <title>Re: SPARSEDATA format with three (row, coeff) pairs</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SPARSEDATA-format-with-three-row-coeff-pairs/m-p/35316#M336</link>
      <description>Hi Philipp,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your reply. Your guess that "Maybe LP uses the smallest or the last row variable size" was absolutely right: I changed ALL _ROWx_ to $28 format and now it works. You must admit, that this behaviour of PROC LP is a bit strange ...&lt;BR /&gt;
&lt;BR /&gt;
Thomas</description>
      <pubDate>Thu, 17 Jun 2010 10:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SPARSEDATA-format-with-three-row-coeff-pairs/m-p/35316#M336</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2010-06-17T10:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: SPARSEDATA format with three (row, coeff) pairs</title>
      <link>https://communities.sas.com/t5/Mathematical-Optimization/SPARSEDATA-format-with-three-row-coeff-pairs/m-p/35317#M337</link>
      <description>Hi Thomas,&lt;BR /&gt;
&lt;BR /&gt;
Yes, this is a strange behavior! Thanks for pointing it out to us.&lt;BR /&gt;
&lt;BR /&gt;
Philipp</description>
      <pubDate>Fri, 18 Jun 2010 13:16:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Mathematical-Optimization/SPARSEDATA-format-with-three-row-coeff-pairs/m-p/35317#M337</guid>
      <dc:creator>Philipp_SAS</dc:creator>
      <dc:date>2010-06-18T13:16:39Z</dc:date>
    </item>
  </channel>
</rss>

