<?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: Whether the next calculation cover 100% the previous calculation? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Whether-the-next-calculation-cover-100-the-previous-calculation/m-p/734605#M228814</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/366546"&gt;@ResoluteCarbon&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When calculating one variable, I accidentally calculate the same named variable by two different methods, they all in the same dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x= y-z;
x=m-n;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am wondering whether the previous &lt;STRONG&gt;x&lt;/STRONG&gt; will be replaced totally by the later &lt;STRONG&gt;x&lt;/STRONG&gt;? Or just be replaced partly? Is there any exception that the later &lt;STRONG&gt;x&lt;/STRONG&gt; just replace the former &lt;STRONG&gt;x&lt;/STRONG&gt; partly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yep.&lt;/P&gt;
&lt;P&gt;When executing code in a data step it evaluates things from the "top" of the data step code to the bottom.&lt;/P&gt;
&lt;P&gt;So if you assign a different value on a line below the first assignment the bottom one is the result.&lt;/P&gt;
&lt;P&gt;The "exceptions" would all come if one or both of the assignments are conditional.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If sex='F' then x = (some calculation based on the sex);&lt;/P&gt;
&lt;P&gt;else if sex='M' then x = (different calculation based on sex);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no "partly" unless you mean a character value where you assign different bits and pieces, which is possible but you would need to do the coding to implement such. With numeric values, not going to happen.&lt;/P&gt;</description>
    <pubDate>Thu, 15 Apr 2021 22:40:49 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2021-04-15T22:40:49Z</dc:date>
    <item>
      <title>Whether the next calculation cover 100% the previous calculation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Whether-the-next-calculation-cover-100-the-previous-calculation/m-p/734599#M228811</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When calculating one variable, I accidentally calculate the same named variable by two different methods, they all in the same dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x= y-z;
x=m-n;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am wondering whether the previous &lt;STRONG&gt;x&lt;/STRONG&gt; will be replaced totally by the later &lt;STRONG&gt;x&lt;/STRONG&gt;? Or just be replaced partly? Is there any exception that the later &lt;STRONG&gt;x&lt;/STRONG&gt; just replace the former &lt;STRONG&gt;x&lt;/STRONG&gt; partly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 22:15:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Whether-the-next-calculation-cover-100-the-previous-calculation/m-p/734599#M228811</guid>
      <dc:creator>ResoluteCarbon</dc:creator>
      <dc:date>2021-04-15T22:15:25Z</dc:date>
    </item>
    <item>
      <title>Re: Whether the next calculation cover 100% the previous calculation?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Whether-the-next-calculation-cover-100-the-previous-calculation/m-p/734605#M228814</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/366546"&gt;@ResoluteCarbon&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi all,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When calculating one variable, I accidentally calculate the same named variable by two different methods, they all in the same dataset:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;x= y-z;
x=m-n;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I am wondering whether the previous &lt;STRONG&gt;x&lt;/STRONG&gt; will be replaced totally by the later &lt;STRONG&gt;x&lt;/STRONG&gt;? Or just be replaced partly? Is there any exception that the later &lt;STRONG&gt;x&lt;/STRONG&gt; just replace the former &lt;STRONG&gt;x&lt;/STRONG&gt; partly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Yep.&lt;/P&gt;
&lt;P&gt;When executing code in a data step it evaluates things from the "top" of the data step code to the bottom.&lt;/P&gt;
&lt;P&gt;So if you assign a different value on a line below the first assignment the bottom one is the result.&lt;/P&gt;
&lt;P&gt;The "exceptions" would all come if one or both of the assignments are conditional.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If sex='F' then x = (some calculation based on the sex);&lt;/P&gt;
&lt;P&gt;else if sex='M' then x = (different calculation based on sex);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There is no "partly" unless you mean a character value where you assign different bits and pieces, which is possible but you would need to do the coding to implement such. With numeric values, not going to happen.&lt;/P&gt;</description>
      <pubDate>Thu, 15 Apr 2021 22:40:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Whether-the-next-calculation-cover-100-the-previous-calculation/m-p/734605#M228814</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2021-04-15T22:40:49Z</dc:date>
    </item>
  </channel>
</rss>

