<?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 How to subtract values to update one variable with Update statement? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-subtract-values-to-update-one-variable-with-Update/m-p/640434#M190762</link>
    <description>&lt;P&gt;I need a help to know to update one field based on the subtraction of two variables from other datasets. Code which I use is shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I want to update error_count value and it should subtract table_count_hub value from table_count value from run_id_received dataset&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;create&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; run_id_received &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; run_id,table_count,table_count_hub,error_count&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; status;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;update&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; main.status&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; table_count_hub =(select table_count_hub from run_id_received),&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; error_count =??? &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008000"&gt;/*I want to subtract table_count_hub value from table_count value from run_id_received dataset*/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2020 13:05:35 GMT</pubDate>
    <dc:creator>David_Billa</dc:creator>
    <dc:date>2020-04-16T13:05:35Z</dc:date>
    <item>
      <title>How to subtract values to update one variable with Update statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-subtract-values-to-update-one-variable-with-Update/m-p/640434#M190762</link>
      <description>&lt;P&gt;I need a help to know to update one field based on the subtraction of two variables from other datasets. Code which I use is shown below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here I want to update error_count value and it should subtract table_count_hub value from table_count value from run_id_received dataset&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;noprint&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;create&lt;/FONT&gt; &lt;FONT face="Courier New" size="3" color="#0000ff"&gt;table&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; run_id_received &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;as&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;select&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; run_id,table_count,table_count_hub,error_count&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;from&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; status;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;sql&lt;/FONT&gt;&lt;/STRONG&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;update&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; main.status&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#0000ff"&gt;set&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt; table_count_hub =(select table_count_hub from run_id_received),&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3"&gt; error_count =??? &lt;/FONT&gt;&lt;FONT face="Courier New" size="3" color="#008000"&gt;/*I want to subtract table_count_hub value from table_count value from run_id_received dataset*/&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Courier New" size="3" color="#000080"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/FONT&gt;&lt;FONT face="Courier New" size="3"&gt;;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 13:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-subtract-values-to-update-one-variable-with-Update/m-p/640434#M190762</guid>
      <dc:creator>David_Billa</dc:creator>
      <dc:date>2020-04-16T13:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to subtract values to update one variable with Update statement?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-subtract-values-to-update-one-variable-with-Update/m-p/641528#M191205</link>
      <description>&lt;P&gt;Please provide us with a 5-line data example of the before and after tables.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Apr 2020 06:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-subtract-values-to-update-one-variable-with-Update/m-p/641528#M191205</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2020-04-21T06:21:48Z</dc:date>
    </item>
  </channel>
</rss>

