<?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: SQL Update ignoring the firstobs and obs statements. in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Update-ignoring-the-firstobs-and-obs-statements/m-p/76577#M22213</link>
    <description>FIRSTOBS and OBS are input options (read).&lt;BR /&gt;
&lt;BR /&gt;
See the DETAILS section of the online doc:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000131129.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000131129.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
    <pubDate>Fri, 23 Oct 2009 08:28:28 GMT</pubDate>
    <dc:creator>DanielSantos</dc:creator>
    <dc:date>2009-10-23T08:28:28Z</dc:date>
    <item>
      <title>SQL Update ignoring the firstobs and obs statements.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Update-ignoring-the-firstobs-and-obs-statements/m-p/76576#M22212</link>
      <description>Hi all,&lt;BR /&gt;
&lt;BR /&gt;
Here is some behaviour I didn't expect:&lt;BR /&gt;
&lt;BR /&gt;
proc sql ;&lt;BR /&gt;
  create table junk as&lt;BR /&gt;
  select *  from NewPremises(firstobs = 5 obs=5);&lt;BR /&gt;
  update NewPremises(firstobs = 5 obs=5) set PremisesId = 99;&lt;BR /&gt;
quit;&lt;BR /&gt;
----------------------------------&lt;BR /&gt;
9185   proc sql ;&lt;BR /&gt;
9186     create table junk as&lt;BR /&gt;
9187     select *  from NewPremises(firstobs = 5 obs=5);&lt;BR /&gt;
NOTE: Table WORK.JUNK created, with 1 rows and 8 columns.&lt;BR /&gt;
&lt;BR /&gt;
9188     update NewPremises(firstobs = 5 obs=5) set PremisesId = 99;&lt;BR /&gt;
NOTE: 52798 rows were updated in WORK.NEWPREMISES.&lt;BR /&gt;
&lt;BR /&gt;
9189   quit;&lt;BR /&gt;
-------------------------------------------&lt;BR /&gt;
&lt;BR /&gt;
Why does the Update statement ignore the FIRSTOBS and OBS statment and update the entire dataset, but the select statement works as I expected?&lt;BR /&gt;
&lt;BR /&gt;
Also, does anybody know of a way to update a row based on it's row number?&lt;BR /&gt;
&lt;BR /&gt;
I appreciate any insight you may have.&lt;BR /&gt;
Curtis</description>
      <pubDate>Thu, 22 Oct 2009 22:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Update-ignoring-the-firstobs-and-obs-statements/m-p/76576#M22212</guid>
      <dc:creator>CurtisMack</dc:creator>
      <dc:date>2009-10-22T22:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Update ignoring the firstobs and obs statements.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Update-ignoring-the-firstobs-and-obs-statements/m-p/76577#M22213</link>
      <description>FIRSTOBS and OBS are input options (read).&lt;BR /&gt;
&lt;BR /&gt;
See the DETAILS section of the online doc:&lt;BR /&gt;
&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000131129.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/62618/HTML/default/a000131129.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
Cheers from Portugal.&lt;BR /&gt;
&lt;BR /&gt;
Daniel Santos @ &lt;A href="http://www.cgd.pt" target="_blank"&gt;www.cgd.pt&lt;/A&gt;</description>
      <pubDate>Fri, 23 Oct 2009 08:28:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Update-ignoring-the-firstobs-and-obs-statements/m-p/76577#M22213</guid>
      <dc:creator>DanielSantos</dc:creator>
      <dc:date>2009-10-23T08:28:28Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Update ignoring the firstobs and obs statements.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Update-ignoring-the-firstobs-and-obs-statements/m-p/76578#M22214</link>
      <description>The only efficient way to update y row number in SAS as far as I know is using the data step, MODIFY and POINT.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Fri, 23 Oct 2009 08:39:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Update-ignoring-the-firstobs-and-obs-statements/m-p/76578#M22214</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2009-10-23T08:39:52Z</dc:date>
    </item>
    <item>
      <title>Re: SQL Update ignoring the firstobs and obs statements.</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/SQL-Update-ignoring-the-firstobs-and-obs-statements/m-p/76579#M22215</link>
      <description>Thanks for both of your replies.  It confirms my suspisions that there is no way to do this in PROC SQL.  I use MODIFY in most of my DB processing, but in the particular solution I am working on, I am stuck in SQL.  I have found an inellegant solution that I will just have to live with.&lt;BR /&gt;
Thanks Again!</description>
      <pubDate>Fri, 23 Oct 2009 18:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/SQL-Update-ignoring-the-firstobs-and-obs-statements/m-p/76579#M22215</guid>
      <dc:creator>CurtisMack</dc:creator>
      <dc:date>2009-10-23T18:23:35Z</dc:date>
    </item>
  </channel>
</rss>

