<?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 Convert Null to Zero in SAS Enterprise Guide</title>
    <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-Null-to-Zero/m-p/4260#M1354</link>
    <description>I am creating a computed column in a query task of SAS EG 4.1. For the computed column I am subtracting field b from field a, for example (a-b). a has a value of 643 and column b, for this particular row, has a value of null. My result ends up being null instead of 643. How do I get the query task to treat the null as a zero so that my computed column has a resulting value of 643?&lt;BR /&gt;
&lt;BR /&gt;
As a side note, in some cases column b has a value other than null, so it is only for the calculations where b is equal to null that I need b to be recognized as a 0.&lt;BR /&gt;
&lt;BR /&gt;
Please help if you can. Thank you!&lt;BR /&gt;
Jackie</description>
    <pubDate>Mon, 20 Aug 2007 23:20:50 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2007-08-20T23:20:50Z</dc:date>
    <item>
      <title>Convert Null to Zero</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-Null-to-Zero/m-p/4260#M1354</link>
      <description>I am creating a computed column in a query task of SAS EG 4.1. For the computed column I am subtracting field b from field a, for example (a-b). a has a value of 643 and column b, for this particular row, has a value of null. My result ends up being null instead of 643. How do I get the query task to treat the null as a zero so that my computed column has a resulting value of 643?&lt;BR /&gt;
&lt;BR /&gt;
As a side note, in some cases column b has a value other than null, so it is only for the calculations where b is equal to null that I need b to be recognized as a 0.&lt;BR /&gt;
&lt;BR /&gt;
Please help if you can. Thank you!&lt;BR /&gt;
Jackie</description>
      <pubDate>Mon, 20 Aug 2007 23:20:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-Null-to-Zero/m-p/4260#M1354</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-20T23:20:50Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Null to Zero</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-Null-to-Zero/m-p/4261#M1355</link>
      <description>hopefully you can use data-step functions in your compute&lt;BR /&gt;
&lt;BR /&gt;
   result = sum( value1, valueX, anotherValue ) ;&lt;BR /&gt;
&lt;BR /&gt;
The result holds the sum of non-missing variables .&lt;BR /&gt;
&lt;BR /&gt;
proper doc for the base SAS sum function is at &lt;A href="http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000245953.htm" target="_blank"&gt;http://support.sas.com/onlinedoc/913/getDoc/en/lrdict.hlp/a000245953.htm&lt;/A&gt;&lt;BR /&gt;
&lt;BR /&gt;
I'm not sure if there is a corresponding place for anything E.G.-specific for computed columns in a query&lt;BR /&gt;
&lt;BR /&gt;
Good Luck&lt;BR /&gt;
&lt;BR /&gt;
PeterC</description>
      <pubDate>Tue, 21 Aug 2007 07:48:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-Null-to-Zero/m-p/4261#M1355</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-21T07:48:55Z</dc:date>
    </item>
    <item>
      <title>Re: Convert Null to Zero</title>
      <link>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-Null-to-Zero/m-p/4262#M1356</link>
      <description>Thank you Peter this worked very well.  This is what I did...&lt;BR /&gt;
&lt;BR /&gt;
From the computed column box I selcted the "functions" tab and picked "sum". Then I clicked on the "data" tab and built the computation like this...&lt;BR /&gt;
&lt;BR /&gt;
SUM(TableA.FieldA, -TableB.FieldB). I added in the negative sign before the second variable (TableB.FieldB) in order for the sum to work properly for subtracting FieldB. &lt;BR /&gt;
&lt;BR /&gt;
This is just what I needed. Thanks again!!!&lt;BR /&gt;
Jackie</description>
      <pubDate>Tue, 21 Aug 2007 15:01:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Enterprise-Guide/Convert-Null-to-Zero/m-p/4262#M1356</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2007-08-21T15:01:51Z</dc:date>
    </item>
  </channel>
</rss>

