<?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 SQL is too slow! in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-is-too-slow/m-p/42045#M10903</link>
    <description>Hi everyone,&lt;BR /&gt;
&lt;BR /&gt;
I'm reading and writing values to a table using the PROC SQL procedure and it is much slower than I had hoped.  I'm using code like the following:&lt;BR /&gt;
&lt;BR /&gt;
*read a value into a variable;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
    SELECT var1 INTO :check FROM table1 WHERE row = 7;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
*write a value to a table;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
    UPDATE table1 SET var1 = 8 WHERE row = 10;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Each of these is taking around 0.5s to execute.  Am I doing this wrong?  Is there a more efficient way to read/write like this?  Should I read the tables into memory using something like SASFILE for faster access?  PROC SQL is pretty new to me so I'm open to all suggestions.&lt;BR /&gt;
&lt;BR /&gt;
I'm running EG4.1 on XP.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
-MBI</description>
    <pubDate>Mon, 08 Jun 2009 16:14:21 GMT</pubDate>
    <dc:creator>MBI</dc:creator>
    <dc:date>2009-06-08T16:14:21Z</dc:date>
    <item>
      <title>PROC SQL is too slow!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-is-too-slow/m-p/42045#M10903</link>
      <description>Hi everyone,&lt;BR /&gt;
&lt;BR /&gt;
I'm reading and writing values to a table using the PROC SQL procedure and it is much slower than I had hoped.  I'm using code like the following:&lt;BR /&gt;
&lt;BR /&gt;
*read a value into a variable;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
    SELECT var1 INTO :check FROM table1 WHERE row = 7;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
*write a value to a table;&lt;BR /&gt;
proc sql;&lt;BR /&gt;
    UPDATE table1 SET var1 = 8 WHERE row = 10;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
Each of these is taking around 0.5s to execute.  Am I doing this wrong?  Is there a more efficient way to read/write like this?  Should I read the tables into memory using something like SASFILE for faster access?  PROC SQL is pretty new to me so I'm open to all suggestions.&lt;BR /&gt;
&lt;BR /&gt;
I'm running EG4.1 on XP.&lt;BR /&gt;
&lt;BR /&gt;
Thanks!&lt;BR /&gt;
&lt;BR /&gt;
-MBI</description>
      <pubDate>Mon, 08 Jun 2009 16:14:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-is-too-slow/m-p/42045#M10903</guid>
      <dc:creator>MBI</dc:creator>
      <dc:date>2009-06-08T16:14:21Z</dc:date>
    </item>
    <item>
      <title>Re: PROC SQL is too slow!</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-is-too-slow/m-p/42046#M10904</link>
      <description>No sure what you want to achieve, so my reply will be incomplete, but here are a few starting points:&lt;BR /&gt;
- are the datasets indexed by variable ROW?&lt;BR /&gt;
- calling proc sql over and over is slower than calling it once and then doing all the SELECTs or UPDATEs&lt;BR /&gt;
- yes, sasfile might help, you should test it.&lt;BR /&gt;
&lt;BR /&gt;
To step back a bit though, it is &lt;I&gt;much&lt;/I&gt; slower to update tables one value at a time than to update in bulk by joining, so try and see if you can modify the logic to work in bulk.</description>
      <pubDate>Tue, 09 Jun 2009 02:05:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/PROC-SQL-is-too-slow/m-p/42046#M10904</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-06-09T02:05:57Z</dc:date>
    </item>
  </channel>
</rss>

