<?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 Audit Trail Table in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Audit-Trail-Table/m-p/670152#M201132</link>
    <description>&lt;P&gt;I created an audit trail on my table. However, when I altered my table by adding a new column, its audit trail was removed as well. Is there a way to prevent this from happening or audit trail doesn't work when a table is altered?&lt;/P&gt;</description>
    <pubDate>Fri, 17 Jul 2020 15:38:20 GMT</pubDate>
    <dc:creator>iSAS</dc:creator>
    <dc:date>2020-07-17T15:38:20Z</dc:date>
    <item>
      <title>Audit Trail Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Audit-Trail-Table/m-p/670152#M201132</link>
      <description>&lt;P&gt;I created an audit trail on my table. However, when I altered my table by adding a new column, its audit trail was removed as well. Is there a way to prevent this from happening or audit trail doesn't work when a table is altered?&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 15:38:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Audit-Trail-Table/m-p/670152#M201132</guid>
      <dc:creator>iSAS</dc:creator>
      <dc:date>2020-07-17T15:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: Audit Trail Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Audit-Trail-Table/m-p/670157#M201133</link>
      <description>&lt;P&gt;From documentation on audit trails&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;DIV class="xis-eDocBody"&gt;
&lt;DIV id="n0ndg2uekz7qkbn1caoki2hzqx8l" class="xis-topic"&gt;
&lt;DIV id="p18qlvfrjo7stin1lxgxc46x00yc" class="xis-subTopic"&gt;
&lt;H2 class="xis-title"&gt;Preservation by Other Operations&lt;/H2&gt;
&lt;DIV id="n1ezcbjexrqoe7n16kad358imvya" class="xis-topicContent"&gt;
&lt;DIV id="n055hrwxplemj2n1xpeqib6fy25d" class="xis-paragraph"&gt;The audit trail is not recommended for data files that are copied, moved, sorted in place, &lt;STRONG&gt;replaced,&lt;/STRONG&gt; or transferred to another &lt;A id="GTn0n7oo99d80qf2n141sm61m3n1ql" class="glossTerm" target="_blank"&gt;&lt;/A&gt;operating environment. Those operations do not preserve the audit trail. In a Copy operation on the same &lt;A id="GTp12qii8gkt5x4pn13d9kqbccgehg" class="glossTerm" target="_blank"&gt;&lt;/A&gt;host, you can preserve the data file and audit trail by renaming them using the generation data sets feature. However, logging stops because neither the auditing process nor the generation data sets feature saves the source program that caused the replacement. For more information about generation data sets,&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;A key word I highlight above is REPLACE. The way SAS manages data once a data set is created then anything that adds a variable replaces the data step.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It might help to describe why you are adding variables to a data set that needs auditing.&lt;/P&gt;
&lt;P&gt;If the reason was something like "didn't know I needed it" you have a live and learn moment.&lt;/P&gt;
&lt;P&gt;If the reason is following the often dubious spread sheet approach of adding a separate column for every year/month/week or every level of a product then the data design is just plain wrong, especially for audit purposes, and you would be better off having a variable to hold the "type" of value.&lt;/P&gt;
&lt;P&gt;instead of&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Store&amp;nbsp; JanSalesTotal FebSalesTotal MarSalesTotal &amp;lt;etc&amp;gt;&lt;/P&gt;
&lt;P&gt;better would be&lt;/P&gt;
&lt;P&gt;Store SalesMonth&amp;nbsp; Total&lt;/P&gt;
&lt;P&gt;where SalesMonth would take values like Jan Feb Mar, which are currently data in the title of the variable.&lt;/P&gt;
&lt;P&gt;)best would likely be to store that Month as an actual SAS date such as the first or last day of the reporting month)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might also look at the SASHELP.CARS data set for a product type example. Instead of having separate values for Sedan, SUV, Pickup or such and a separate price, engine size, horsepower column fore each type of car you have the type as a variable.&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>Fri, 17 Jul 2020 16:05:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Audit-Trail-Table/m-p/670157#M201133</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-17T16:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Audit Trail Table</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Audit-Trail-Table/m-p/671308#M201566</link>
      <description>Thank you for the detailed explanation ballardw!&lt;BR /&gt;&lt;BR /&gt;Would just like to ask, is there a command to turn-off audit trail in a table?</description>
      <pubDate>Wed, 22 Jul 2020 08:49:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Audit-Trail-Table/m-p/671308#M201566</guid>
      <dc:creator>iSAS</dc:creator>
      <dc:date>2020-07-22T08:49:18Z</dc:date>
    </item>
  </channel>
</rss>

