<?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 need help to modify query for better processing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/need-help-to-modify-query-for-better-processing/m-p/808161#M318656</link>
    <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have below query which takes 30minutes to complete.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please suggest any bottleneck here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;create table X as ( select * from Y a inner join Z b on input(b.emp_id,11.) = a.emp_id&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;where a.sale_dt &amp;gt;= b.sale_dt and a.sale_dt &amp;lt; b.sale_last_dt );&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Source Table A has: 3.6M data &amp;amp; B table has 3.3M data.&lt;/P&gt;
&lt;P&gt;Output of this query gives 3.5M data and its taking 30 min to complete. Is there any way to reduce the process time.&lt;/P&gt;
&lt;P&gt;Please suggest?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 16 Apr 2022 11:08:54 GMT</pubDate>
    <dc:creator>Banu</dc:creator>
    <dc:date>2022-04-16T11:08:54Z</dc:date>
    <item>
      <title>need help to modify query for better processing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-help-to-modify-query-for-better-processing/m-p/808161#M318656</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have below query which takes 30minutes to complete.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please suggest any bottleneck here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;proc sql;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;create table X as ( select * from Y a inner join Z b on input(b.emp_id,11.) = a.emp_id&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;where a.sale_dt &amp;gt;= b.sale_dt and a.sale_dt &amp;lt; b.sale_last_dt );&lt;/P&gt;
&lt;P&gt;quit;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Source Table A has: 3.6M data &amp;amp; B table has 3.3M data.&lt;/P&gt;
&lt;P&gt;Output of this query gives 3.5M data and its taking 30 min to complete. Is there any way to reduce the process time.&lt;/P&gt;
&lt;P&gt;Please suggest?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Apr 2022 11:08:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-help-to-modify-query-for-better-processing/m-p/808161#M318656</guid>
      <dc:creator>Banu</dc:creator>
      <dc:date>2022-04-16T11:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: need help to modify query for better processing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/need-help-to-modify-query-for-better-processing/m-p/808163#M318658</link>
      <description>&lt;P&gt;Here is :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;

     create table X as ( select * from Y a inner join Z b on &lt;FONT size="5" color="#FF0000"&gt;input(b.emp_id,11.)&lt;/FONT&gt; = a.emp_id

     where a.sale_dt &amp;gt;= b.sale_dt and a.sale_dt &amp;lt; b.sale_last_dt );

quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Make a data step before SQL to convert this variable by INPUT().&lt;/P&gt;
&lt;PRE&gt;data Y1;
&amp;nbsp;set Y;
new_emp_id=input(emp_id,11.);
run;

proc sql;
..................&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Apr 2022 11:36:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/need-help-to-modify-query-for-better-processing/m-p/808163#M318658</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2022-04-16T11:36:57Z</dc:date>
    </item>
  </channel>
</rss>

