<?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: Audit column values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Audit-column-values/m-p/749774#M235691</link>
    <description>&lt;P&gt;By column values, I assume that you mean in a SAS dataset not an external database.&amp;nbsp; Assuming you have sufficient disk space, you could use the generations feature of SAS to create multiple versions of a SAS dataset.&amp;nbsp; Every time a SAS job runs that changes the value of a dataset, a new generation is created and the old generation is renamed to include a #nnnn in it's name where nnnn is the generation of the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you would need to do periodically is to do some kind of a compare of the current generation with all generations created since the last time you checked for changes.&amp;nbsp; I think this could be a lot of work, particularly if a lot of generations are created between each check, but you could do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could read the Audit Trail dataset and then base on what the Audit Trail tells you, you probably could create the columns that you're trying to create.&amp;nbsp; I haven't tried this, but assuming the Audit Trail feature captures the particulars of the changes you're interested in, you should be able to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
    <pubDate>Wed, 23 Jun 2021 03:17:38 GMT</pubDate>
    <dc:creator>jimbarbour</dc:creator>
    <dc:date>2021-06-23T03:17:38Z</dc:date>
    <item>
      <title>Audit column values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Audit-column-values/m-p/749506#M235534</link>
      <description>&lt;P&gt;Hi everyone ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have to track changes made to column values . For example , If there is a column Passed with value yes .&lt;/P&gt;
&lt;TABLE width="129"&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD width="129"&gt;Passed&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Yes&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;Now ,If the user updates the value to No , then I want to track the change in value , the user who changed the value and the timestamp when the change occurred.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 334pt;" width="445"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="129" height="20" style="width: 97pt; height: 15.0pt;"&gt;Passed&lt;/TD&gt;
&lt;TD width="130" style="width: 98pt;"&gt;Previous_value&lt;/TD&gt;
&lt;TD width="80" style="width: 60pt;"&gt;Change_by&lt;/TD&gt;
&lt;TD width="106" style="width: 80pt;"&gt;timestamp&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;No&lt;/TD&gt;
&lt;TD&gt;Yes&lt;/TD&gt;
&lt;TD&gt;user1&lt;/TD&gt;
&lt;TD align="right"&gt;6/22/21 6:15 PM&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I came across the &lt;A href="https://v8doc.sas.com/sashtml/lrcon/z1224397.htm" target="_self"&gt;Audit Trail&lt;/A&gt;&amp;nbsp;feature , but it creates a separate dataset. I want to add new columns i.e. previous_value , change_by and timestamp to the table being tracked.&lt;/P&gt;
&lt;P&gt;Is there a way to achieve this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 12:58:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Audit-column-values/m-p/749506#M235534</guid>
      <dc:creator>kaziumair</dc:creator>
      <dc:date>2021-06-22T12:58:55Z</dc:date>
    </item>
    <item>
      <title>Re: Audit column values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Audit-column-values/m-p/749769#M235688</link>
      <description>&lt;P&gt;&lt;EM&gt;&amp;gt; &amp;nbsp;I want to add new columns&amp;nbsp;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;That's a very strange way to do things. Do you want to keep adding columns with every change? How do you know it was column PASSED that was changed in your example?&lt;/P&gt;
&lt;P&gt;Or is the second table you are showing us a custom-built audit table? If so you are creating a second data set anyway.&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 03:50:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Audit-column-values/m-p/749769#M235688</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-06-23T03:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Audit column values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Audit-column-values/m-p/749774#M235691</link>
      <description>&lt;P&gt;By column values, I assume that you mean in a SAS dataset not an external database.&amp;nbsp; Assuming you have sufficient disk space, you could use the generations feature of SAS to create multiple versions of a SAS dataset.&amp;nbsp; Every time a SAS job runs that changes the value of a dataset, a new generation is created and the old generation is renamed to include a #nnnn in it's name where nnnn is the generation of the dataset.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What you would need to do periodically is to do some kind of a compare of the current generation with all generations created since the last time you checked for changes.&amp;nbsp; I think this could be a lot of work, particularly if a lot of generations are created between each check, but you could do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you could read the Audit Trail dataset and then base on what the Audit Trail tells you, you probably could create the columns that you're trying to create.&amp;nbsp; I haven't tried this, but assuming the Audit Trail feature captures the particulars of the changes you're interested in, you should be able to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Jim&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 03:17:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Audit-column-values/m-p/749774#M235691</guid>
      <dc:creator>jimbarbour</dc:creator>
      <dc:date>2021-06-23T03:17:38Z</dc:date>
    </item>
    <item>
      <title>Re: Audit column values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Audit-column-values/m-p/749776#M235693</link>
      <description>&lt;P&gt;You could also store history in the table using an SCD2 approach (new row per change with a new valid from and eventually valid to date) - or a live and history table where you update/insert into the live table (=1 row per "id") and always also insert a change to the history table (=1 row per "id" and date).&lt;/P&gt;</description>
      <pubDate>Wed, 23 Jun 2021 03:38:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Audit-column-values/m-p/749776#M235693</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-06-23T03:38:16Z</dc:date>
    </item>
  </channel>
</rss>

