<?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: what can be used instead of proc update for a big data set? in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245209#M17434</link>
    <description>&lt;P&gt;I don't have anything to test this on, but basic datastep has an update statement as well:&lt;/P&gt;
&lt;PRE&gt;data want;
  update &amp;lt;master_dataset&amp;gt; &amp;lt;update_dateset&amp;gt;;
  by &amp;lt;id_variables&amp;gt;;
run;&lt;/PRE&gt;
&lt;P&gt;This should run far quicker than SQL - the SQL in SAS tends to be quite resource intensive. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202975.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202975.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 21 Jan 2016 15:36:25 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-01-21T15:36:25Z</dc:date>
    <item>
      <title>what can be used instead of proc update for a big data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245180#M17428</link>
      <description>&lt;P&gt;when i use proc update to update 12 fields in a 5.5M data set, it takes a long time.&lt;/P&gt;&lt;P&gt;Any suggestions to replace proc update?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 14:10:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245180#M17428</guid>
      <dc:creator>Maicemuallem</dc:creator>
      <dc:date>2016-01-21T14:10:37Z</dc:date>
    </item>
    <item>
      <title>Re: what can be used instead of proc update for a big data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245181#M17429</link>
      <description>&lt;P&gt;Do you mean PROC SQL with the UPDATE statement? &amp;nbsp;You might want to share some more details about your data scheme and how you're having to update records within it.&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 14:12:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245181#M17429</guid>
      <dc:creator>ChrisHemedinger</dc:creator>
      <dc:date>2016-01-21T14:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: what can be used instead of proc update for a big data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245182#M17430</link>
      <description>&lt;P&gt;If you are updating all records of the table, you may find recreating the table will be faster.&lt;/P&gt;
&lt;P&gt;This with a data step, or a SQL create table as select from...&lt;/P&gt;
&lt;P&gt;Is it a SAS data set/table?&lt;/P&gt;
&lt;P&gt;Any indexes/constraints in the equation?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 14:17:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245182#M17430</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2016-01-21T14:17:04Z</dc:date>
    </item>
    <item>
      <title>Re: what can be used instead of proc update for a big data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245185#M17432</link>
      <description>&lt;P&gt;yes. It is a proc sql.&lt;/P&gt;&lt;P&gt;my data has 475 variables and 5.5 Million observations. I am interested in updating 11 variables for only 65,000 observations&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 14:23:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245185#M17432</guid>
      <dc:creator>Maicemuallem</dc:creator>
      <dc:date>2016-01-21T14:23:15Z</dc:date>
    </item>
    <item>
      <title>Re: what can be used instead of proc update for a big data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245209#M17434</link>
      <description>&lt;P&gt;I don't have anything to test this on, but basic datastep has an update statement as well:&lt;/P&gt;
&lt;PRE&gt;data want;
  update &amp;lt;master_dataset&amp;gt; &amp;lt;update_dateset&amp;gt;;
  by &amp;lt;id_variables&amp;gt;;
run;&lt;/PRE&gt;
&lt;P&gt;This should run far quicker than SQL - the SQL in SAS tends to be quite resource intensive. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202975.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000202975.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 15:36:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245209#M17434</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-01-21T15:36:25Z</dc:date>
    </item>
    <item>
      <title>Re: what can be used instead of proc update for a big data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245257#M17435</link>
      <description>&lt;P&gt;I created test data&lt;FONT face="helvetica"&gt;:&lt;/FONT&gt;&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;dataset BIG with 475 variables (one numeric ID with length 8 and 474 character variables of length 1,&amp;nbsp;populated with random letters) and 5.5 million observations (sorted by ID, file size 2.5 GB)&lt;/LI&gt;
&lt;LI&gt;dataset TA (for transaction) with 65000 obs. and 12 variables: ID with randomly selected values from BIG and 11 randomly selected character variables from BIG, populated with '#' characters and about 2% missing values, also sorted by ID.&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;Then I let a data step with UPDATE statement, as suggested by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9﻿&lt;/a&gt;, and an equivalent PROC SQL step (using a LEFT JOIN and the COALESCE function, not an UPDATE statement) run three times each to create the updated dataset WANT (or WANT1, resp.).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Run times (in seconds):&lt;/P&gt;
&lt;P&gt;Data step: 5.09, 5.52, 5.64&lt;/P&gt;
&lt;P&gt;PROC SQL: 9.03, 9.47, 9.41&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The difference is highly significant (&lt;EM&gt;t&lt;/EM&gt; test, p&amp;lt;.0001).&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For another comparison, I updated BIG directly ("in place") using PROC SQL's UPDATE statement and the WHERE clause&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where id in (select id from ta);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;With (hard-coded) &lt;U&gt;constant&lt;/U&gt; transaction data ('#') this was faster (average run time 4.4 s), but with a subquery pulling the real transaction data from dataset TA &lt;EM&gt;for only one&lt;/EM&gt; of the 11 variables to be updated, the run time went up to about 87 s and would probably have been much higher, had this been done for the remaining 10 character variables as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally, I tried the MODIFY statement of the data step to update the (recreated) dataset BIG in place:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data big;
modify big ta;
by id;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This step took so long that I terminated it after about 15 minutes. According to what it had accomplished up to this time, it would have taken about 8400 s to finish.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So, bottom line is (as expected): Run time depends heavily on the update method used.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/69500"&gt;@Maicemuallem﻿&lt;/a&gt;: How does your PROC SQL step look like (not in detail, just the structure)?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 19:21:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245257#M17435</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2016-01-21T19:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: what can be used instead of proc update for a big data set?</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245298#M17436</link>
      <description>&lt;P&gt;That was very helpful, thanks&lt;/P&gt;</description>
      <pubDate>Thu, 21 Jan 2016 21:02:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/what-can-be-used-instead-of-proc-update-for-a-big-data-set/m-p/245298#M17436</guid>
      <dc:creator>Maicemuallem</dc:creator>
      <dc:date>2016-01-21T21:02:32Z</dc:date>
    </item>
  </channel>
</rss>

