<?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: time stamping a database in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760407#M80892</link>
    <description>&lt;P&gt;I will have to look up what you mean. I am not new to SAS but there are still many many many things I don't know/understand.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Aug 2021 16:11:06 GMT</pubDate>
    <dc:creator>K_S</dc:creator>
    <dc:date>2021-08-09T16:11:06Z</dc:date>
    <item>
      <title>time stamping a database</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760404#M80890</link>
      <description>&lt;P&gt;How do I put a time stamp onto a sas database? I want the person whom I will be sending my database to to see when the database was output.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 16:01:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760404#M80890</guid>
      <dc:creator>K_S</dc:creator>
      <dc:date>2021-08-09T16:01:50Z</dc:date>
    </item>
    <item>
      <title>Re: time stamping a database</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760406#M80891</link>
      <description>It's included as part of the metadata of the data set is it not?&lt;BR /&gt;Did you check the sashelp.vtable data set and the date modified/created fields?</description>
      <pubDate>Mon, 09 Aug 2021 16:06:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760406#M80891</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-09T16:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: time stamping a database</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760407#M80892</link>
      <description>&lt;P&gt;I will have to look up what you mean. I am not new to SAS but there are still many many many things I don't know/understand.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Aug 2021 16:11:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760407#M80892</guid>
      <dc:creator>K_S</dc:creator>
      <dc:date>2021-08-09T16:11:06Z</dc:date>
    </item>
    <item>
      <title>Re: time stamping a database</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760408#M80893</link>
      <description>&lt;A href="https://support.sas.com/resources/papers/proceedings15/3458-2015.pdf" target="_blank"&gt;https://support.sas.com/resources/papers/proceedings15/3458-2015.pdf&lt;/A&gt;&lt;BR /&gt;This may be helpful then.</description>
      <pubDate>Mon, 09 Aug 2021 16:15:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760408#M80893</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-08-09T16:15:19Z</dc:date>
    </item>
    <item>
      <title>Re: time stamping a database</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760490#M80894</link>
      <description>&lt;P&gt;Usually external databases timestamp table rows as you could be updating rows at different times. If you want to use this methodology in SAS apply the DATETIME function to a new variable in your dataset in a DATA step:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  timestamp = datetime();
  format timestamp datetime22;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Aug 2021 22:30:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/760490#M80894</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-08-09T22:30:55Z</dc:date>
    </item>
    <item>
      <title>Re: time stamping a database</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/762248#M80929</link>
      <description>All SAS datasets are time stamped. Use proc contents to see this.</description>
      <pubDate>Wed, 18 Aug 2021 10:58:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/762248#M80929</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-08-18T10:58:20Z</dc:date>
    </item>
    <item>
      <title>Re: time stamping a database</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/762251#M80930</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/127053"&gt;@K_S&lt;/a&gt;&amp;nbsp;Just to clarify what others already said.&lt;/P&gt;
&lt;P&gt;SAS tables are nothing else than files on the file system with an extension of .sas7bdat&lt;/P&gt;
&lt;P&gt;A SAS file contains internally some metadata header information and then the data. In the header information there is also the datetime when the file has been created. That's what you get when running Proc Contents.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to log the time per data row (and not the whole file) then you need to create and populate a variable which holds this information. That's the proposed solution using the data step with the datetime() function.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And last but not least: Most of the time SAS tables (.sas7bdat files) get fully recreated. If using SQL or a SAS data step modify or update statement then you can also update a SAS table in place and though file creation and file modification date might differ.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sample code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create a new table */
data test;
  set sashelp.class;
run;

/* create a new table by replacing a same named source table                     */
/* -&amp;gt; because it's a new table creation and modification DateTime will be the same  */
data test;
  set test;
run;

/** modify an existing table. Creation and modification DateTime will differ **/
/* wait a second */
data _null_;
  call sleep(1,1);
run;
/* update (modify) table in place (=not re-creating it) */
proc sql;
  update test
  set name='ABC'
  where name='Alfred'
  ;
quit;

/* report on table metadata */
proc contents data=test;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1629288855970.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/62677i1A4DE8F1ABCA90E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_0-1629288855970.png" alt="Patrick_0-1629288855970.png" /&gt;&lt;/span&gt;&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>Wed, 18 Aug 2021 12:19:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/time-stamping-a-database/m-p/762251#M80930</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-08-18T12:19:53Z</dc:date>
    </item>
  </channel>
</rss>

