<?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 replace Null value with Zero in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843549#M36610</link>
    <description>&lt;P&gt;&lt;SPAN&gt;Hello All, I am modifying an existing code and facing Error - "the mean summary function requires a numeric argument" The Code is:- proc sql; create table ECL_&amp;amp;report_mth._Sum as select report_mth ,final_stage ,count(ECL) as volume ,sum (balance) as balance ,sum (ECL) as ECL ,mean(ECL) as avg_ECL ,sum (ECL_Post) as ECL_Post ,mean(ECL_Post) as avg_ECL_Post ,mean(PiT_PD) as PiT_PD from ECL_&amp;amp;report_mth._Study2 group by 1,2; quit; I see Null Values in ECL_&amp;amp;report_mth._Study2 table so I guess this is related to it. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone please tell me How can I fix this error??? &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 10 Nov 2022 09:40:59 GMT</pubDate>
    <dc:creator>NikitaA</dc:creator>
    <dc:date>2022-11-10T09:40:59Z</dc:date>
    <item>
      <title>How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843352#M36589</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;&lt;P&gt;I am modifying an existing code and facing Error - "the mean summary function requires a numeric argument"&lt;/P&gt;&lt;P&gt;The Code is:-&lt;/P&gt;&lt;P&gt;proc sql;&lt;BR /&gt;create table ECL_&amp;amp;report_mth._Sum as&lt;BR /&gt;select report_mth&lt;BR /&gt;,final_stage&lt;/P&gt;&lt;P&gt;,count(ECL) as volume&lt;/P&gt;&lt;P&gt;,sum (balance) as balance&lt;BR /&gt;,sum (ECL) as ECL&lt;BR /&gt;,mean(ECL) as avg_ECL&lt;BR /&gt;,sum (ECL_Post) as ECL_Post&lt;BR /&gt;,mean(ECL_Post) as avg_ECL_Post&lt;BR /&gt;,mean(PiT_PD) as PiT_PD&lt;BR /&gt;from ECL_&amp;amp;report_mth._Study2&lt;BR /&gt;group by 1,2;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;I see Null Values in ECL_&amp;amp;report_mth._Study2 table so I guess this is related to it.&lt;/P&gt;&lt;P&gt;Can anyone please tell me what should be added in order to resolve this error???&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 13:24:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843352#M36589</guid>
      <dc:creator>NikitaA</dc:creator>
      <dc:date>2022-11-09T13:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843357#M36590</link>
      <description>&lt;P&gt;The Mean Funtion can handle missing/null values. The problem is that one of the variables being fed to the Mean Function is not numeric.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 13:37:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843357#M36590</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-11-09T13:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843380#M36591</link>
      <description>&lt;P&gt;By "null" value do you mean that you see TEXT of NULL in the data set? That very likely means that variable is not numeric as unless you do some work with custom formats SAS will not display missing (i.e. "null") values as the word Null.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/436949"&gt;@NikitaA&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello All,&lt;/P&gt;
&lt;P&gt;I am modifying an existing code and facing Error - "the mean summary function requires a numeric argument"&lt;/P&gt;
&lt;P&gt;The Code is:-&lt;/P&gt;
&lt;P&gt;proc sql;&lt;BR /&gt;create table ECL_&amp;amp;report_mth._Sum as&lt;BR /&gt;select report_mth&lt;BR /&gt;,final_stage&lt;/P&gt;
&lt;P&gt;,count(ECL) as volume&lt;/P&gt;
&lt;P&gt;,sum (balance) as balance&lt;BR /&gt;,sum (ECL) as ECL&lt;BR /&gt;,mean(ECL) as avg_ECL&lt;BR /&gt;,sum (ECL_Post) as ECL_Post&lt;BR /&gt;,mean(ECL_Post) as avg_ECL_Post&lt;BR /&gt;,mean(PiT_PD) as PiT_PD&lt;BR /&gt;from ECL_&amp;amp;report_mth._Study2&lt;BR /&gt;group by 1,2;&lt;BR /&gt;quit;&lt;/P&gt;
&lt;P&gt;I see Null Values in ECL_&amp;amp;report_mth._Study2 table so I guess this is related to it.&lt;/P&gt;
&lt;P&gt;Can anyone please tell me what should be added in order to resolve this error???&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 15:32:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843380#M36591</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-11-09T15:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843381#M36592</link>
      <description>&lt;P&gt;In addition to the good replies so far, do you understand that replace a null with a zero and then computing a mean produces and invalid and incorrect mean value? I strongly advise against this.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 15:38:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843381#M36592</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-11-09T15:38:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843397#M36593</link>
      <description>&lt;PRE&gt;proc sql;
create table ECL_&amp;amp;report_mth._Sum as
select report_mth
,final_stage

,count(ECL) as volume

,sum (balance) as balance
,sum (ECL) as ECL
&lt;STRONG&gt;&lt;FONT color="#3366FF"&gt;,mean(ECL) as avg_ECL&lt;/FONT&gt;&lt;/STRONG&gt;
,sum (ECL_Post) as ECL_Post
&lt;FONT color="#3366FF"&gt;&lt;STRONG&gt;,mean(ECL_Post) as avg_ECL_Post
,mean(PiT_PD) as PiT_PD&lt;/STRONG&gt;&lt;/FONT&gt;
from ECL_&amp;amp;report_mth._Study2
group by 1,2;
quit;&lt;/PRE&gt;
&lt;P&gt;One of the variables in the MEAN statement (highlighted) is character and needs to be numeric. If so, you should also get errors on the SUM statements. PiT_PD is the only variable that's only on the MEAN statement so it could be that variable but it's easy enough to check them all.&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 16:07:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843397#M36593</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-11-09T16:07:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843543#M36606</link>
      <description>&lt;P&gt;Yes, that's true... Can you please suggest how to fix this??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 09:15:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843543#M36606</guid>
      <dc:creator>NikitaA</dc:creator>
      <dc:date>2022-11-10T09:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843544#M36607</link>
      <description>&lt;P&gt;Yes, You're right! Can you please suggest how to fix this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 09:17:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843544#M36607</guid>
      <dc:creator>NikitaA</dc:creator>
      <dc:date>2022-11-10T09:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843548#M36608</link>
      <description>&lt;P&gt;You must find out why a variable supposed to be numeric is in fact character. You have to inspect the process which creates your dataset.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 09:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843548#M36608</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-10T09:39:35Z</dc:date>
    </item>
    <item>
      <title>How to replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843549#M36610</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Hello All, I am modifying an existing code and facing Error - "the mean summary function requires a numeric argument" The Code is:- proc sql; create table ECL_&amp;amp;report_mth._Sum as select report_mth ,final_stage ,count(ECL) as volume ,sum (balance) as balance ,sum (ECL) as ECL ,mean(ECL) as avg_ECL ,sum (ECL_Post) as ECL_Post ,mean(ECL_Post) as avg_ECL_Post ,mean(PiT_PD) as PiT_PD from ECL_&amp;amp;report_mth._Study2 group by 1,2; quit; I see Null Values in ECL_&amp;amp;report_mth._Study2 table so I guess this is related to it. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Can anyone please tell me How can I fix this error??? &amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 09:40:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843549#M36610</guid>
      <dc:creator>NikitaA</dc:creator>
      <dc:date>2022-11-10T09:40:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843550#M36609</link>
      <description>&lt;P&gt;Ah I understand, thanks... We have recently experienced change in our process and started importing an excel file which has Null values and hence causing this problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks Again!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 09:55:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843550#M36609</guid>
      <dc:creator>NikitaA</dc:creator>
      <dc:date>2022-11-10T09:55:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to Replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843552#M36611</link>
      <description>&lt;P&gt;Excel files are notoriously bad as means for transporting data across environments. Use text files which you read with a data step, where&amp;nbsp;&lt;U&gt;you&lt;/U&gt; have total control over column attributes.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 10:23:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843552#M36611</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-10T10:23:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to replace Null value with Zero</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843553#M36612</link>
      <description>&lt;P&gt;I moved this back in here, as the question is still the same.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 10:24:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-Replace-Null-value-with-Zero/m-p/843553#M36612</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-11-10T10:24:13Z</dc:date>
    </item>
  </channel>
</rss>

