<?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: proc SQL on Dictionary VS. data step on sashelp: why is data step so slow in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518465#M140319</link>
    <description>&lt;P&gt;You didn't indicate which one took longer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that the SQL version ran quicker as I have seen that occur and I believe that it has to do with the nature of a SAS VIEW, which the sashelp.vtable is and optimizations used with the DICTIONARY equivalent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I note that on my system that the data step approach can create notes such as&lt;/P&gt;
&lt;PRE&gt;NOTE: The map data sets in library MAPSGFK are based on the digital maps from GfK GeoMarketing
      and are covered by their Copyright. For additional information, see
      http://support.sas.com/mapsonline/gfklicense.
&lt;/PRE&gt;
&lt;P&gt;that the SQL dictionary table doesn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For giggles you should also try&amp;nbsp;Proc SQl addressing the sashelp.vtable instead of the Dictionary table&amp;nbsp;as another comparison. On my system the time for the data step and Proc Sql using sashelp.vtable are nearly identical though CPU time is slightly less for Proc SQL.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Dec 2018 16:13:43 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2018-12-04T16:13:43Z</dc:date>
    <item>
      <title>proc SQL on Dictionary VS. data step on sashelp: why is data step so slow</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518362#M140280</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to return the info in the sashelp.vtable/dictionary.tables for a specific dataset.&lt;/P&gt;&lt;P&gt;Works fine but &lt;STRONG&gt;why does one take 11 minutes and the other not even a second?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was expecting some difference but not this much of a difference.&lt;/P&gt;&lt;P&gt;Note though that at this location they defined an enormous amount of libs and datasets at start-up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just curious for your thoughts on this...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;%macro DSInfo(DSInfo,LibName,DSName);
data &amp;amp;DSInfo;
  set sashelp.vTable (where = (libname = %upcase("&amp;amp;LibName") and memname=upcase("&amp;amp;DSName") ) );
run;
%mend;

%macro DSInfo2(DSInfo,LibName,DSName);
proc sql noprint;
  create table &amp;amp;DSInfo as select * from dictionary.tables where libname = upcase("&amp;amp;LibName") and memname = upcase("&amp;amp;DSName");
quit;
%mend;

%let StartTime = %sysfunc(time());
%DSInfo(DSInfo,WORK,_prodsavail);
%let EndTime = %sysfunc(time());
* Anders komt de LOG-booschap niet als 1 geheel: source even uitschakelen;
options nosource;
%put ***********************************************************************;
%put Programma duur: %sysfunc(putn(%sysevalf(&amp;amp;EndTime-&amp;amp;StartTime),time10.2));
%put ***********************************************************************;
options source;

%let StartTime = %sysfunc(time());
%DSInfo2(DSInfoSQL,WORK,_prodsavail);
%let EndTime = %sysfunc(time());
* Anders komt de LOG-booschap niet als 1 geheel: source even uitschakelen;
options nosource;
%put ***********************************************************************;
%put Programma duur: %sysfunc(putn(%sysevalf(&amp;amp;EndTime-&amp;amp;StartTime),time10.2));
%put ***********************************************************************;
options source;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 12:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518362#M140280</guid>
      <dc:creator>dirkvk</dc:creator>
      <dc:date>2018-12-04T12:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: proc SQL on Dictionary VS. data step on sashelp: why is data step so slow</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518365#M140282</link>
      <description>&lt;P&gt;Which SAS version is implemented?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have the impression that SAS has improved the way a where condition in the data step is handed over to the SQL view, because with earlier SAS versions I found that using the view led to a read through &lt;EM&gt;all&lt;/EM&gt; datasets in &lt;EM&gt;all&lt;/EM&gt; libraries before the where condition was applied.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 12:46:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518365#M140282</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-04T12:46:09Z</dc:date>
    </item>
    <item>
      <title>Re: proc SQL on Dictionary VS. data step on sashelp: why is data step so slow</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518375#M140285</link>
      <description>&lt;P&gt;Hi Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks 4 your reply. I am on SAS 9.3 at this client. Running in EG 5.1 if that matters.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 13:19:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518375#M140285</guid>
      <dc:creator>dirkvk</dc:creator>
      <dc:date>2018-12-04T13:19:02Z</dc:date>
    </item>
    <item>
      <title>Re: proc SQL on Dictionary VS. data step on sashelp: why is data step so slow</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518383#M140288</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/172460"&gt;@dirkvk&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi Kurt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks 4 your reply. I am on SAS 9.3 at this client. Running in EG 5.1 if that matters.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;They should seriously consider upgrading to 9.4M5. I have not experienced a performance penalty with the view in a similar situation:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data class;
set sashelp.class;
run;

data info1;
set sashelp.vtable (where=(libname = upcase("work") and memname= upcase('class')));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That took just a fraction of a second, even though I have lots of libraries with several hundred thousand datasets active.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Dec 2018 08:09:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518383#M140288</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2018-12-05T08:09:31Z</dc:date>
    </item>
    <item>
      <title>Re: proc SQL on Dictionary VS. data step on sashelp: why is data step so slow</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518465#M140319</link>
      <description>&lt;P&gt;You didn't indicate which one took longer.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suspect that the SQL version ran quicker as I have seen that occur and I believe that it has to do with the nature of a SAS VIEW, which the sashelp.vtable is and optimizations used with the DICTIONARY equivalent.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I note that on my system that the data step approach can create notes such as&lt;/P&gt;
&lt;PRE&gt;NOTE: The map data sets in library MAPSGFK are based on the digital maps from GfK GeoMarketing
      and are covered by their Copyright. For additional information, see
      http://support.sas.com/mapsonline/gfklicense.
&lt;/PRE&gt;
&lt;P&gt;that the SQL dictionary table doesn't.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For giggles you should also try&amp;nbsp;Proc SQl addressing the sashelp.vtable instead of the Dictionary table&amp;nbsp;as another comparison. On my system the time for the data step and Proc Sql using sashelp.vtable are nearly identical though CPU time is slightly less for Proc SQL.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Dec 2018 16:13:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/518465#M140319</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2018-12-04T16:13:43Z</dc:date>
    </item>
    <item>
      <title>Re: proc SQL on Dictionary VS. data step on sashelp: why is data step so slow</title>
      <link>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/621620#M182754</link>
      <description>&lt;P&gt;Hey, just now I realized that I did not answer here - It was the data step on the view that took 11 minutes, :-), as you suspected.&lt;BR /&gt;&lt;BR /&gt;Thanks all 4 your input!&lt;/P&gt;</description>
      <pubDate>Sat, 01 Feb 2020 11:20:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/proc-SQL-on-Dictionary-VS-data-step-on-sashelp-why-is-data-step/m-p/621620#M182754</guid>
      <dc:creator>dirkvk</dc:creator>
      <dc:date>2020-02-01T11:20:22Z</dc:date>
    </item>
  </channel>
</rss>

