<?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 Modify taking lot of time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Modify-taking-lot-of-time/m-p/600027#M173333</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically we have table loader code from SAS DI which looks as below. We are using Update Insert technique in DI and hence below is the code which is used. However, it is taking whole lot of time. sasdata is sas library. And we have indexes on both the tables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sasdata.TBL_DTLS_ERROR_APD has 212354 records and&amp;nbsp;etls_lastTable has 60000 records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am out of all my ideas on how to reduce this time of execution. Any help is really appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;data sasdata.TBL_DTLS_ERROR_APD; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;length etls_msg $200; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;drop etls_msg; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;modify sasdata.TBL_DTLS_ERROR_APD &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;amp;etls_lastTable&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;updatemode = nomissingcheck &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;; &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;by POL_NUM_TXT INSURED_ID;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;/* if the record does not exist in the master, then add it */ &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if %sysrc(_DSENMR) eq _iorc_ then &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;output; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;/* if the record exists in the master, then replace it */ &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;else if %sysrc(_SOK) eq _iorc_ then &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;replace; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%if &amp;amp;etls_StopOnIORC ne %then&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if _iorc_ in (&amp;amp;etls_StopOnIORC) then&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;etls_msg = iorcmsg();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;put etls_msg; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%rcSetDS(5)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;stop;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;_iorc_ = 0; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;_error_ = 0; &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;run; &lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2019 11:42:43 GMT</pubDate>
    <dc:creator>yashpande</dc:creator>
    <dc:date>2019-10-29T11:42:43Z</dc:date>
    <item>
      <title>Modify taking lot of time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Modify-taking-lot-of-time/m-p/600027#M173333</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hi All,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically we have table loader code from SAS DI which looks as below. We are using Update Insert technique in DI and hence below is the code which is used. However, it is taking whole lot of time. sasdata is sas library. And we have indexes on both the tables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;sasdata.TBL_DTLS_ERROR_APD has 212354 records and&amp;nbsp;etls_lastTable has 60000 records.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am out of all my ideas on how to reduce this time of execution. Any help is really appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;data sasdata.TBL_DTLS_ERROR_APD; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;length etls_msg $200; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;drop etls_msg; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;modify sasdata.TBL_DTLS_ERROR_APD &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&amp;amp;etls_lastTable&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;updatemode = nomissingcheck &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;; &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;by POL_NUM_TXT INSURED_ID;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;/* if the record does not exist in the master, then add it */ &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if %sysrc(_DSENMR) eq _iorc_ then &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;output; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;/* if the record exists in the master, then replace it */ &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;else if %sysrc(_SOK) eq _iorc_ then &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;replace; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%if &amp;amp;etls_StopOnIORC ne %then&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;if _iorc_ in (&amp;amp;etls_StopOnIORC) then&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;do;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;etls_msg = iorcmsg();&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;put etls_msg; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%rcSetDS(5)&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;stop;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;%end;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;_iorc_ = 0; &lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;_error_ = 0; &lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;run; &lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 11:42:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Modify-taking-lot-of-time/m-p/600027#M173333</guid>
      <dc:creator>yashpande</dc:creator>
      <dc:date>2019-10-29T11:42:43Z</dc:date>
    </item>
    <item>
      <title>Re: Modify taking lot of time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Modify-taking-lot-of-time/m-p/600115#M173384</link>
      <description>&lt;P&gt;What's the actual run time for this? While you may think it's long it may be "normal". Not saying it can't be improved but it's a matter of how much more could you potentially improve it from where it's at. Some code can be cut in half on execution time, while others extensive changes and/or re-writing it might only improve by milliseconds.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2019 16:58:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Modify-taking-lot-of-time/m-p/600115#M173384</guid>
      <dc:creator>Krueger</dc:creator>
      <dc:date>2019-10-29T16:58:24Z</dc:date>
    </item>
    <item>
      <title>Re: Modify taking lot of time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Modify-taking-lot-of-time/m-p/600344#M173511</link>
      <description>&lt;P&gt;A couple of ideas on how to improve performance:&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Make sure that your index is the right one: when looking up rows using two variables, it should be a composite index&amp;nbsp;&lt;BR /&gt;(like in "create index idx on&amp;nbsp;sasdata.TBL_DTLS_ERROR_APD(POL_NUM_TXT,INSURED_ID)",&lt;BR /&gt;not two simple indexes on the two variables&lt;/LI&gt;
&lt;LI&gt;If you can, keep your master data sorted on the index variables (when it is not in use, run a PROC SORT withe the FORCE option, and then recreate the index)&lt;/LI&gt;
&lt;LI&gt;Having an index on the transaction data set will not help, best you can do is to sort it by the key variables.&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 30 Oct 2019 12:03:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Modify-taking-lot-of-time/m-p/600344#M173511</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-10-30T12:03:33Z</dc:date>
    </item>
  </channel>
</rss>

