<?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: To treat missing values with zeros in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740066#M231111</link>
    <description>&lt;P&gt;Besides of a do loop you could also use Proc Stdize as proposed in the solution &lt;A href="https://communities.sas.com/t5/SAS-Procedures/How-to-set-all-missing-values-to-zero-for-all-variables/td-p/41478" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 09 May 2021 23:23:40 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2021-05-09T23:23:40Z</dc:date>
    <item>
      <title>To treat missing values with zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740061#M231109</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;
&lt;P&gt;I wrote a loop that goes through variables to replace dot (a missing value) with zero; Now I want to add another loop to go through observations as well.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is my code and your help is greatly appreciated. Blue Blue&lt;/P&gt;
&lt;PRE&gt;Data simpleData;&lt;BR /&gt;Input Var1 Var2 Var4 Var5 Var6 Var7 Var8 ;&lt;BR /&gt;&lt;BR /&gt;cards;&lt;BR /&gt;&lt;BR /&gt;5 7 3 6 5 8 3&lt;BR /&gt;&lt;BR /&gt;4 7 3 6 5 8 3&lt;BR /&gt;&lt;BR /&gt;3 6 3 3 5 8 3&lt;BR /&gt;&lt;BR /&gt;5 4 3 . 3 8 3&lt;BR /&gt;&lt;BR /&gt;5 4 3 3 3 8 3&lt;BR /&gt;&lt;BR /&gt;5 . 3 3 3 8 3&lt;BR /&gt;&lt;BR /&gt;5 7 3 3 3 8 1&lt;BR /&gt;&lt;BR /&gt;5 7 3 3 3 8 0&lt;BR /&gt;&lt;BR /&gt;run;&lt;BR /&gt;data mathtop;&lt;BR /&gt;set simpleData;&lt;BR /&gt;varResult = var1 * var2;&lt;BR /&gt;Array varArr(7)  Var1 Var2 Var4 Var5 Var6 Var7 Var8;&lt;BR /&gt;Do i = 1 to 7;&lt;BR /&gt;if varArr(i)=. Then varArr(i)=0;&lt;BR /&gt;var9 = var4 + var8;&lt;BR /&gt;end;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 21:16:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740061#M231109</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-05-09T21:16:52Z</dc:date>
    </item>
    <item>
      <title>Re: To treat missing values with zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740065#M231110</link>
      <description>&lt;P&gt;You don't need a loop to process observations as SAS automatically will process all rows one after the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;View your MATHTOP dataset to prove this program is already working correctly.&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 21:32:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740065#M231110</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-05-09T21:32:27Z</dc:date>
    </item>
    <item>
      <title>Re: To treat missing values with zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740066#M231111</link>
      <description>&lt;P&gt;Besides of a do loop you could also use Proc Stdize as proposed in the solution &lt;A href="https://communities.sas.com/t5/SAS-Procedures/How-to-set-all-missing-values-to-zero-for-all-variables/td-p/41478" target="_self"&gt;here&lt;/A&gt;.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 23:23:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740066#M231111</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-05-09T23:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: To treat missing values with zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740067#M231112</link>
      <description>&lt;P&gt;I hope you have a really really really good reason why you want to replace missings with zeros, as there are plenty of situations where this is not a good idea (and a few situations where this makes sense). A word to the wise...&lt;/P&gt;</description>
      <pubDate>Sun, 09 May 2021 23:25:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740067#M231112</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-05-09T23:25:10Z</dc:date>
    </item>
    <item>
      <title>Re: To treat missing values with zeros</title>
      <link>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740071#M231113</link>
      <description>One example of a program that doesn't need to replace missing values with zero is the one you posted.  You can get the same result by replacing everything from the array statement to the end with:&lt;BR /&gt;&lt;BR /&gt;var9 = sum(0, var4, var8);</description>
      <pubDate>Mon, 10 May 2021 01:44:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/To-treat-missing-values-with-zeros/m-p/740071#M231113</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2021-05-10T01:44:25Z</dc:date>
    </item>
  </channel>
</rss>

