<?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: Saving new table with update date in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Saving-new-table-with-update-date/m-p/725093#M225177</link>
    <description>&lt;P&gt;Thank you for your response. The case is that I need to extract the penultimate one from the saved tables, not the last one.&lt;/P&gt;</description>
    <pubDate>Wed, 10 Mar 2021 10:15:42 GMT</pubDate>
    <dc:creator>PatrykSAS</dc:creator>
    <dc:date>2021-03-10T10:15:42Z</dc:date>
    <item>
      <title>Saving new table with update date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-new-table-with-update-date/m-p/725083#M225174</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have a 2-part problem. Firstly, I want to keep historical information from the table while updating it.&amp;nbsp;Second, I want to add the data from the penultimate table to the current dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the first part, there is a table with id and score which can change every week/month.&amp;nbsp;When updating the data, I want to save the table with the update date to the "ODSHMS" library. When data is refreshed twice on the same day, the table should overwrite the previous one with the same date. I would like to achieve the following effect.&lt;/P&gt;
&lt;P&gt;TABLE updated 05.01.2021 is saved as TABLE_05012021 when updated 10.03.2021 saved as TABLE_10032021 etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regarding the second part of the problem, I would like to add the columns from the table that was updated one before last to the data set. So if I have tables: TABLE_05012021, TABLE_14022021 and TABLE_10032021 then I want to refer to&amp;nbsp;TABLE_14022021 and join columns with target dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am asking for your support and have a nice day &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 09:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-new-table-with-update-date/m-p/725083#M225174</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-03-10T09:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Saving new table with update date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-new-table-with-update-date/m-p/725088#M225175</link>
      <description>&lt;P&gt;First, do not use the DMY order for such things. Use a YMD order instead, so the names sort nicely.&lt;/P&gt;
&lt;P&gt;Second, this is the code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data table_%sysfunc(today(),yymmddn8.);
set table;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Mar 2021 09:53:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-new-table-with-update-date/m-p/725088#M225175</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-03-10T09:53:36Z</dc:date>
    </item>
    <item>
      <title>Re: Saving new table with update date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-new-table-with-update-date/m-p/725093#M225177</link>
      <description>&lt;P&gt;Thank you for your response. The case is that I need to extract the penultimate one from the saved tables, not the last one.&lt;/P&gt;</description>
      <pubDate>Wed, 10 Mar 2021 10:15:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-new-table-with-update-date/m-p/725093#M225177</guid>
      <dc:creator>PatrykSAS</dc:creator>
      <dc:date>2021-03-10T10:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Saving new table with update date</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Saving-new-table-with-update-date/m-p/725095#M225179</link>
      <description>&lt;P&gt;When using an intelligent date order (that's why I said you &lt;STRONG&gt;DO NOT USE&lt;/STRONG&gt; DMY dates), the last is the penultimate. Don't make your job unnecessarily hard by using stupid data structures.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finding the last dataset in a series is then extremely easy:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql noprint;
select max(memname) into :lastname
from dictionary.tables
where library = "LIBRARY" and memname like 'TABLE_%';
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 10 Mar 2021 10:31:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Saving-new-table-with-update-date/m-p/725095#M225179</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-03-10T10:31:52Z</dc:date>
    </item>
  </channel>
</rss>

