<?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 missing values with . in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17285#M3266</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;case when admitdt2 is not null and (dischdt1 &amp;lt;&amp;gt; admitdt2) then (admitdt2 - dischdt1) &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;else 0&lt;/STRONG&gt;&lt;/SPAN&gt; end as time1 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 28 Feb 2012 20:37:24 GMT</pubDate>
    <dc:creator>Hima</dc:creator>
    <dc:date>2012-02-28T20:37:24Z</dc:date>
    <item>
      <title>missing values with .</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17284#M3265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am doing a case statement to calculate date1 to date2 for admissions. Some of them come back with an elapsed time like 527 or 15 but then others come back with a . because there is no elapsed time. I know SAS puts in a . when you are calculating for numeric and there is no value. I want to code my case statement so it will still calculate the elapsed time but if it finds a . it will make it just a 0. I tried the following but it does not work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case when admitdt2 is not null and (dischdt1 &amp;lt;&amp;gt; admitdt2) then (admitdt2 - dischdt1) end as time1&lt;/P&gt;&lt;P&gt;case when admitdt3 is not null and (dischdt2 &amp;lt;&amp;gt; admitdt3) then (admitdt3 - dischdt2) end as time2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This code has more cases for all admit and disch dates and goes up to time30. Because some have no numeric return it replaces it with a . because it does not have a value to return.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to code in my case that if there is no numeric returned to put a 0 in instead of that .&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I thought maybe&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case when admitdt2 is not null and (dischdt1 &amp;lt;&amp;gt; admitdt2) then (admitdt2 - dischdt1)&amp;nbsp; end as time1 &lt;/P&gt;&lt;P&gt;if time1 = . then 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That does not work&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 20:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17284#M3265</guid>
      <dc:creator>tmm</dc:creator>
      <dc:date>2012-02-28T20:34:53Z</dc:date>
    </item>
    <item>
      <title>missing values with .</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17285#M3266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;case when admitdt2 is not null and (dischdt1 &amp;lt;&amp;gt; admitdt2) then (admitdt2 - dischdt1) &lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;else 0&lt;/STRONG&gt;&lt;/SPAN&gt; end as time1 &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 20:37:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17285#M3266</guid>
      <dc:creator>Hima</dc:creator>
      <dc:date>2012-02-28T20:37:24Z</dc:date>
    </item>
    <item>
      <title>missing values with .</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17286#M3267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;tmmm,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should be able to do this without a CASE clause, something like:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;sum(0, admitdt2-dischdt1) as time1,&lt;/P&gt;&lt;P&gt;sum(0, admitdt3-dischdt2) as time 2&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Feb 2012 20:48:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17286#M3267</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2012-02-28T20:48:21Z</dc:date>
    </item>
    <item>
      <title>missing values with .</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17287#M3268</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not sure whether this code could work. not test.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;case when admitdt2 is not null and (dischdt1 &amp;lt;&amp;gt; admitdt2) then&lt;STRONG&gt; ifn( admitdt2 - dischdt1=.,0, admitdt2 - dischdt1) &lt;/STRONG&gt;end&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 02:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17287#M3268</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-02-29T02:21:48Z</dc:date>
    </item>
    <item>
      <title>missing values with .</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17288#M3269</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt; The SQL syntax to use when replacing missing values with something else is the COALESCE function:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;select coalesce(dischdt2 - admitdt1, 0) as time1,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; coalesce(dischdt4 - admitdt3, 0) as time2, ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;also, since most DBMS have functions equivalent to coalesce, SAS can translate when accessing remote data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 02:40:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17288#M3269</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2012-02-29T02:40:13Z</dc:date>
    </item>
    <item>
      <title>missing values with .</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17289#M3270</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Feb 2012 15:40:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/missing-values-with/m-p/17289#M3270</guid>
      <dc:creator>tmm</dc:creator>
      <dc:date>2012-02-29T15:40:45Z</dc:date>
    </item>
  </channel>
</rss>

