<?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: Macro sql feels slow - please run this code and tell me your results! in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36986#M7302</link>
    <description>10 secs 1.86GHz Processor, 1.5GB RAM, Windows XP.&lt;BR /&gt;
&lt;BR /&gt;
~ Sukanya E</description>
    <pubDate>Wed, 27 May 2009 23:29:06 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-05-27T23:29:06Z</dc:date>
    <item>
      <title>Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36983#M7299</link>
      <description>Hi everyone,&lt;BR /&gt;
&lt;BR /&gt;
I'm having what I perceive as slowness issues in my macro sql code and want to determine if it's just my computer.  The code below cycles through creating and deleting a table 1000 times.  It takes my computer 18 seconds to run.  If anyone has a spare minute, can you let me know how long this takes to run on your pc and what kind of hardware you're using?&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
&lt;BR /&gt;
-MBI&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%macro timetest();&lt;BR /&gt;
	%do i = 1 %to 1000;&lt;BR /&gt;
			proc sql noprint;&lt;BR /&gt;
				CREATE TABLE tabletest (test int);&lt;BR /&gt;
				DROP TABLE tabletest;&lt;BR /&gt;
			run;&lt;BR /&gt;
	%end;&lt;BR /&gt;
%mend timetest;&lt;BR /&gt;
%timetest()</description>
      <pubDate>Tue, 26 May 2009 23:28:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36983#M7299</guid>
      <dc:creator>MBI</dc:creator>
      <dc:date>2009-05-26T23:28:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36984#M7300</link>
      <description>About 6.6 seconds of cpu time.  Run twice.&lt;BR /&gt;
&lt;BR /&gt;
batch SAS 9.2, Phase 2. Windows XP SP 2, Lenovo T61p laptop.</description>
      <pubDate>Wed, 27 May 2009 01:36:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36984#M7300</guid>
      <dc:creator>Doc_Duke</dc:creator>
      <dc:date>2009-05-27T01:36:19Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36985#M7301</link>
      <description>1 min 17.5secs on a busy 32bit win-XP machine with 4gb memory, running SAS9.1.3-sp4 Display Manager</description>
      <pubDate>Wed, 27 May 2009 13:04:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36985#M7301</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-05-27T13:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36986#M7302</link>
      <description>10 secs 1.86GHz Processor, 1.5GB RAM, Windows XP.&lt;BR /&gt;
&lt;BR /&gt;
~ Sukanya E</description>
      <pubDate>Wed, 27 May 2009 23:29:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36986#M7302</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-05-27T23:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36987#M7303</link>
      <description>0.01 seconds using EG4.1 on citrix</description>
      <pubDate>Wed, 27 May 2009 23:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36987#M7303</guid>
      <dc:creator>DerekAdams</dc:creator>
      <dc:date>2009-05-27T23:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36988#M7304</link>
      <description>3.4 s elapse on &lt;BR /&gt;
SAS (r) 9.1 (TS1M3) DMS&lt;BR /&gt;
XP_PRO SP2&lt;BR /&gt;
E8500 @ 3.16 GHz&lt;BR /&gt;
&lt;BR /&gt;
Peter, do something about your PC!  &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;</description>
      <pubDate>Thu, 28 May 2009 03:48:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36988#M7304</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-05-28T03:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36989#M7305</link>
      <description>Being teased a little about my system performance, I decided to look a little closer.&lt;BR /&gt;
I'm using a single processor machine, which might affect results. &lt;BR /&gt;
I was testing the run under DM, where calculating total cpu time is inconvenient across 100 steps, let alone 1000! &lt;BR /&gt;
Under batch SAS9.1 the log shows the totalled time at a more reasonable pace[pre]      real time           22.46 seconds&lt;BR /&gt;
      user cpu time       1.49 seconds&lt;BR /&gt;
      system cpu time     2.82 seconds[/pre]&lt;BR /&gt;
However, under DM there are extra overheads (like EG but different). &lt;BR /&gt;
To simplify the calculation of total cpu for 1000 creates/deletes, I tested this variation&lt;BR /&gt;
%macro timetst() ;&lt;BR /&gt;
%do i = 1 %to 1000 ;&lt;BR /&gt;
CREATE TABLE tabletest (test int) ;&lt;BR /&gt;
DROP TABLE tabletest ;&lt;BR /&gt;
%end ;&lt;BR /&gt;
%mend timetst ;&lt;BR /&gt;
 &lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
%timetst() ;&lt;BR /&gt;
quit;&lt;BR /&gt;
 &lt;BR /&gt;
This provides times for the single SQL step:[pre]NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           18.46 seconds&lt;BR /&gt;
      user cpu time       0.92 seconds&lt;BR /&gt;
      system cpu time     2.10 seconds&lt;BR /&gt;
      Memory                            60k [/pre]&lt;BR /&gt;
Running the code in batch provided these step times[pre]NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           15.71 seconds&lt;BR /&gt;
      user cpu time       0.85 seconds&lt;BR /&gt;
      system cpu time     2.42 seconds&lt;BR /&gt;
      Memory                            60k[/pre] &lt;BR /&gt;
There is no way my elapse time would be below 10 secs let alone under 4 secs!&lt;BR /&gt;
 &lt;BR /&gt;
Perhaps I should not load up my machine with so many activities;-)&lt;BR /&gt;
 &lt;BR /&gt;
PeterC</description>
      <pubDate>Thu, 28 May 2009 09:45:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36989#M7305</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-05-28T09:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36990#M7306</link>
      <description>Using Peter.C's revised code,&lt;BR /&gt;
&lt;BR /&gt;
%macro timetst() ;&lt;BR /&gt;
%do i = 1 %to 1000 ;&lt;BR /&gt;
CREATE TABLE tabletest (test int) ;&lt;BR /&gt;
DROP TABLE tabletest ;&lt;BR /&gt;
%end ;&lt;BR /&gt;
%mend timetst ;&lt;BR /&gt;
&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
%timetst() ;&lt;BR /&gt;
quit;&lt;BR /&gt;
&lt;BR /&gt;
my result using EG4.1 over citrix,sas 9.1.3 windows 2003 at work is&lt;BR /&gt;
&lt;BR /&gt;
NOTE: PROCEDURE SQL used (Total process time):&lt;BR /&gt;
      real time           1.37 seconds&lt;BR /&gt;
      cpu time            1.39 seconds&lt;BR /&gt;
&lt;BR /&gt;
with eg4.1 , sas 9.1.3 running thru vmware server, (server 2003) on a laptop dual core 2ghz with 1gb ram available, the same code results are&lt;BR /&gt;
&lt;BR /&gt;
real time 3.31 seconds&lt;BR /&gt;
cpu time 2.73 seconds&lt;BR /&gt;
&lt;BR /&gt;
On the same machine  using sas 9.1.3 sp4 DM&lt;BR /&gt;
real time 2.64seconds&lt;BR /&gt;
cpu time 2.54 seconds</description>
      <pubDate>Thu, 28 May 2009 22:04:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36990#M7306</guid>
      <dc:creator>DerekAdams</dc:creator>
      <dc:date>2009-05-28T22:04:49Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36991#M7307</link>
      <description>Calling proc sql once is cheating &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Peter's code yields 1.9s elapse and 1.8s CPU, so twice as fast.&lt;BR /&gt;
&lt;BR /&gt;
I timed using&lt;BR /&gt;
[pre]&lt;BR /&gt;
%macro timetest();&lt;BR /&gt;
%do i = 1 %to 1000;&lt;BR /&gt;
proc sql noprint;&lt;BR /&gt;
CREATE TABLE tabletest (test int);&lt;BR /&gt;
DROP TABLE tabletest;&lt;BR /&gt;
run;&lt;BR /&gt;
%end;&lt;BR /&gt;
%mend timetest;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
%let a=%sysfunc(time());&lt;BR /&gt;
%timetest()&lt;BR /&gt;
&lt;BR /&gt;
%put %sysevalf(%sysfunc(time())-&amp;amp;a);&lt;BR /&gt;
[/pre]</description>
      <pubDate>Thu, 28 May 2009 22:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36991#M7307</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2009-05-28T22:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36992#M7308</link>
      <description>is there any way to obtain the cpu time used over a group of steps (for example, from accumulated CPU time in session so far, which we only see in the log as the SAS session closes) ?</description>
      <pubDate>Fri, 29 May 2009 11:00:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36992#M7308</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-05-29T11:00:35Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36993#M7309</link>
      <description>Explore using the ALTLOG system option at start-up along with the appropriate diagnostic output settings like FULLSTIME - also consider other SAS performance analysis techniques mentioned in this paper:&lt;BR /&gt;
&lt;BR /&gt;
Solving SAS Performance Problems: Employing Host Based Tools&lt;BR /&gt;
Tony Brown, SAS Institute Inc., Dallas, TX&lt;BR /&gt;
&lt;A href="http://support.sas.com/rnd/papers/sugi31/practicalperf.pdf" target="_blank"&gt;http://support.sas.com/rnd/papers/sugi31/practicalperf.pdf&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 29 May 2009 12:06:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36993#M7309</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-05-29T12:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Macro sql feels slow - please run this code and tell me your results!</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36994#M7310</link>
      <description>thanks for suggestion of the at paper. I'll have a look. &lt;BR /&gt;
I haven't found fullstimer or altlog providing adequate precision to total the brief cpu times of the sql create and delete steps in these steps. That's why I was asking for something else. The time(), datetime() etc. functions enable calculation of (single-threading) wallclock times.  For CPU times, I'm hoping the "practicalPerf" paper might come up with something like ARM (or log4sas).&lt;BR /&gt;
 thanks&lt;BR /&gt;
 &lt;BR /&gt;
PeterC

unfortunately, I'm not finding what I wanted in that paper&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: Peter.C</description>
      <pubDate>Fri, 29 May 2009 12:53:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-sql-feels-slow-please-run-this-code-and-tell-me-your/m-p/36994#M7310</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2009-05-29T12:53:14Z</dc:date>
    </item>
  </channel>
</rss>

