<?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: Create a new variable and give its value as updated when column is updated in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-and-give-its-value-as-updated-when-column/m-p/536769#M147553</link>
    <description>&lt;P&gt;No, what you are doing is using Macro, to generate a whole series of Base SAS code, which is converted to SQL, and then passed over to the Teradata database to execute.&amp;nbsp; As you can see that is four different peices of software.&amp;nbsp; To confound it further, your next question is how to check if the database - last one on the series of technologies - has completed the task.&amp;nbsp; To do that you would then need to read the data back off the database to see if it is correct.&amp;nbsp; Therefore, not just 4 technologies, but at least one write to the database, and one read from the database.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for "&lt;SPAN&gt;for this i have to create a new column as a status of yes or no.can i do that" - that very much depends, you are altering the table structure on the database, are you allowed/able to do such a thing?&amp;nbsp; I would have thought the database structure would be fixed?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Anyways, you would submit a alter table sql statement, something like:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;proc sql;
...
execute('alter table... add status char(20);');
...
quit;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Then you could set that as part of your update statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 19 Feb 2019 15:15:04 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2019-02-19T15:15:04Z</dc:date>
    <item>
      <title>Create a new variable and give its value as updated when column is updated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-and-give-its-value-as-updated-when-column/m-p/536734#M147539</link>
      <description>I have this sample code-i want to create a column in teradata table when data is updated.please help&lt;BR /&gt;I have triend using status='updated' in execute block but i am not able to update the table.&lt;BR /&gt;&lt;BR /&gt;Proc sql,&lt;BR /&gt;Connect to tera,&lt;BR /&gt;%do i=1 to &amp;amp;cnt;&lt;BR /&gt;Execute(update &amp;amp;table&lt;BR /&gt;Set &amp;amp;colm=bquote('&amp;amp;&amp;amp;new&amp;amp;i)&lt;BR /&gt;&amp;amp;colm2=bquote('&amp;amp;&amp;amp;new2&amp;amp;i);&lt;BR /&gt;%end;&lt;BR /&gt;Quit;</description>
      <pubDate>Tue, 19 Feb 2019 14:31:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-and-give-its-value-as-updated-when-column/m-p/536734#M147539</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2019-02-19T14:31:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new variable and give its value as updated when column is updated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-and-give-its-value-as-updated-when-column/m-p/536756#M147543</link>
      <description>&lt;P&gt;You should do this on your database using triggers:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.teradata.com/t5/Database/After-Insert-trigger/td-p/27510" target="_blank"&gt;https://community.teradata.com/t5/Database/After-Insert-trigger/td-p/27510&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do not try to run one piece of software through another, use the software as given, its far far simpler and easier to manage.&lt;/P&gt;
&lt;P&gt;The database connections are there to download and upload data to and from SAS/database, its not there for doing database tasks.&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 14:58:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-and-give-its-value-as-updated-when-column/m-p/536756#M147543</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-19T14:58:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new variable and give its value as updated when column is updated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-and-give-its-value-as-updated-when-column/m-p/536761#M147547</link>
      <description>But i am using various conditions to update a variable and i just want to check if the column i am targetting is being updated or not..for this i have to create a new column as a status of yes or no.can i do that?is it possible.</description>
      <pubDate>Tue, 19 Feb 2019 15:05:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-and-give-its-value-as-updated-when-column/m-p/536761#M147547</guid>
      <dc:creator>nid197</dc:creator>
      <dc:date>2019-02-19T15:05:30Z</dc:date>
    </item>
    <item>
      <title>Re: Create a new variable and give its value as updated when column is updated</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-and-give-its-value-as-updated-when-column/m-p/536769#M147553</link>
      <description>&lt;P&gt;No, what you are doing is using Macro, to generate a whole series of Base SAS code, which is converted to SQL, and then passed over to the Teradata database to execute.&amp;nbsp; As you can see that is four different peices of software.&amp;nbsp; To confound it further, your next question is how to check if the database - last one on the series of technologies - has completed the task.&amp;nbsp; To do that you would then need to read the data back off the database to see if it is correct.&amp;nbsp; Therefore, not just 4 technologies, but at least one write to the database, and one read from the database.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As for "&lt;SPAN&gt;for this i have to create a new column as a status of yes or no.can i do that" - that very much depends, you are altering the table structure on the database, are you allowed/able to do such a thing?&amp;nbsp; I would have thought the database structure would be fixed?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Anyways, you would submit a alter table sql statement, something like:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;proc sql;
...
execute('alter table... add status char(20);');
...
quit;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;Then you could set that as part of your update statement.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Feb 2019 15:15:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-new-variable-and-give-its-value-as-updated-when-column/m-p/536769#M147553</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2019-02-19T15:15:04Z</dc:date>
    </item>
  </channel>
</rss>

