<?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: Maintaining the DB2 table with only 30 days from SAS in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/572297#M12290</link>
    <description>Yes &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt;. ok so we can do that in DB2 not in sas DI you mean?</description>
    <pubDate>Wed, 10 Jul 2019 06:15:12 GMT</pubDate>
    <dc:creator>vickys</dc:creator>
    <dc:date>2019-07-10T06:15:12Z</dc:date>
    <item>
      <title>Maintaining the DB2 table with only 30 days from SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/569366#M11793</link>
      <description>&lt;P&gt;Dear Guru's,&lt;/P&gt;&lt;P&gt;I am struck up with the logic in maintaining the DB2 table with only 30 days data.&lt;BR /&gt;In detail :&lt;BR /&gt;I will load the DB2 table through SAS Job daily. So, once the 31st day date is loaded then the first day data should be deleted or archived like FIFO( 30days).&lt;BR /&gt;so every time I should maintain only 30 days data.&lt;BR /&gt;How can I do that. Can some one please help with user written code.&lt;BR /&gt;Appreciate your inputs&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Vicks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jun 2019 08:54:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/569366#M11793</guid>
      <dc:creator>vickys</dc:creator>
      <dc:date>2019-06-27T08:54:20Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining the DB2 table with only 30 days from SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/569369#M11794</link>
      <description>&lt;P&gt;Without any data, I can only give you an abstract:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where date &amp;gt; today() - 30;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 27 Jun 2019 09:06:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/569369#M11794</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-27T09:06:07Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining the DB2 table with only 30 days from SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/569722#M11858</link>
      <description>&lt;P&gt;Thanks Kurt,&lt;/P&gt;&lt;P&gt;&amp;nbsp;Yes that works, but I am loading daily data into my DB2 table and I am looking to update this&amp;nbsp; table every day so, that the more than 30 days records gets deleted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;BR /&gt;Vicks&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jun 2019 08:39:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/569722#M11858</guid>
      <dc:creator>vickys</dc:creator>
      <dc:date>2019-06-28T08:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining the DB2 table with only 30 days from SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/569724#M11859</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207150"&gt;@vickys&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Thanks Kurt,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Yes that works, but I am loading daily data into my DB2 table and I am looking to update this&amp;nbsp; table every day so, that the more than 30 days records gets deleted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;BR /&gt;Vicks&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;That's exactly what the where condition does, it only keeps observations younger than 30 days. Apply it to your existing dataset:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data new;
set
  old (where=(date &amp;gt; today() - 30))
  import
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 28 Jun 2019 09:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/569724#M11859</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-06-28T09:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining the DB2 table with only 30 days from SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/570030#M11900</link>
      <description>&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/11562"&gt;@Kurt_Bremser&lt;/a&gt; I believe that &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/207150"&gt;@vickys&lt;/a&gt; doesn't want to reload all 30 days each day. Rather add today's data and drop the 31st day data, and not touching the other 29 days.&lt;BR /&gt;If data volumes are fairly small I would go the reload path as Kurt suggests. &lt;BR /&gt;Otherwise, you need some kind of DB2 syntax, like a partitioned table. This drives syntax, especially for creating and dropping partitions.</description>
      <pubDate>Sat, 29 Jun 2019 05:54:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/570030#M11900</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2019-06-29T05:54:47Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining the DB2 table with only 30 days from SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/570522#M11967</link>
      <description>&lt;P&gt;Ups, yeah, the OP is talking about an operation within DB/2. With DB/2 (or any DBMS), one can selectively delete the older observations, as that will really free the spaces (what you don't get with SAS, where space is freed only with a complete rewrite).&lt;/P&gt;</description>
      <pubDate>Tue, 02 Jul 2019 12:42:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/570522#M11967</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-07-02T12:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining the DB2 table with only 30 days from SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/572297#M12290</link>
      <description>Yes &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13674"&gt;@LinusH&lt;/a&gt;. ok so we can do that in DB2 not in sas DI you mean?</description>
      <pubDate>Wed, 10 Jul 2019 06:15:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/572297#M12290</guid>
      <dc:creator>vickys</dc:creator>
      <dc:date>2019-07-10T06:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: Maintaining the DB2 table with only 30 days from SAS</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/572608#M12353</link>
      <description>You can do it from DI. but you probably need to use DB2 specific syntax.&lt;BR /&gt;Suggest that you first develop working code in DB2, then implement it in DI.</description>
      <pubDate>Thu, 11 Jul 2019 05:02:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Maintaining-the-DB2-table-with-only-30-days-from-SAS/m-p/572608#M12353</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2019-07-11T05:02:23Z</dc:date>
    </item>
  </channel>
</rss>

