<?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: Is not missing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751854#M236748</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;The logic I placed might not be correct.&lt;/P&gt;
&lt;P&gt;It is a case statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I want to say that a rate is not equal to blank. How can I say it in SAS? I looked for it a lot and i couldn't find a method to take care of it.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;blue blue&lt;/P&gt;</description>
    <pubDate>Sat, 03 Jul 2021 03:53:05 GMT</pubDate>
    <dc:creator>GN0001</dc:creator>
    <dc:date>2021-07-03T03:53:05Z</dc:date>
    <item>
      <title>Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751836#M236736</link>
      <description>&lt;P&gt;Hello team,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have missing values in SAS data set; when I run the code, extract the data into excel, I can see missing value are displayed by dot. How to filter them out:&lt;/P&gt;
&lt;PRE&gt;case
when (rate &amp;lt;0.25  and rate is not missing) Then 'do this'&lt;/PRE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;blue blue&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 23:14:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751836#M236736</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-07-02T23:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751840#M236738</link>
      <description>&lt;P&gt;To filter your SAS dataset prior to exporting to Excel use the WHERE statement to exclude missing values:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where rate is not missing;
/* or */
where not missing(rate);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 03 Jul 2021 00:09:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751840#M236738</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-07-03T00:09:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751848#M236743</link>
      <description>&lt;P&gt;Missing values are the smallest in tests, so one way to rewrite your test is:&lt;/P&gt;
&lt;PRE&gt;when ( . &amp;lt; RATE &amp;lt; 0.25 )&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 02:59:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751848#M236743</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-05T02:59:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751849#M236744</link>
      <description>Set options missing='', then output missing value will be displayed by blank</description>
      <pubDate>Sat, 03 Jul 2021 02:37:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751849#M236744</guid>
      <dc:creator>djh</dc:creator>
      <dc:date>2021-07-03T02:37:17Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751852#M236747</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;It is a case statement and I can't use where.&lt;/P&gt;
&lt;P&gt;Respectfully,&lt;/P&gt;
&lt;P&gt;blue blue&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 03:49:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751852#M236747</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-07-03T03:49:23Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751854#M236748</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;The logic I placed might not be correct.&lt;/P&gt;
&lt;P&gt;It is a case statement.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If I want to say that a rate is not equal to blank. How can I say it in SAS? I looked for it a lot and i couldn't find a method to take care of it.&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;blue blue&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 03:53:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751854#M236748</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-07-03T03:53:05Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751856#M236749</link>
      <description>&lt;DIV&gt;&lt;SPAN&gt;The&amp;nbsp;missing&amp;nbsp;numeric&amp;nbsp;variable&amp;nbsp;is&amp;nbsp;represented&amp;nbsp;by&amp;nbsp;a&amp;nbsp;dat(.)&amp;nbsp;in&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;data like below, see more&amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lrcon/p175x77t7k6kggn1io94yedqagl3.htm" target="_self"&gt;&amp;nbsp;Working with Missing Values&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="djh_0-1625285921867.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60920iD2B001F80B4E009B/image-size/medium?v=v2&amp;amp;px=400" role="button" title="djh_0-1625285921867.png" alt="djh_0-1625285921867.png" /&gt;&lt;/span&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To check that the rate is not equal blank, the rate must be a&amp;nbsp;c&lt;SPAN&gt;haracter.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I guess the rate in your date may be numeric.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;As mentioned above , you can try&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;when ( . &amp;lt; RATE &amp;lt; 0.25 )&lt;/CODE&gt;&lt;/PRE&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Sat, 03 Jul 2021 04:25:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751856#M236749</guid>
      <dc:creator>djh</dc:creator>
      <dc:date>2021-07-03T04:25:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751859#M236750</link>
      <description>&lt;P&gt;The syntax for a WHERE statement a WHEN clause are the same for this test.&lt;/P&gt;
&lt;LI-CODE lang="sas"&gt;where . &amp;lt; RATE &amp;lt; 0.25 &lt;/LI-CODE&gt;
&lt;P&gt;You should try by yourself.&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 05:33:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751859#M236750</guid>
      <dc:creator>ChrisNZ</dc:creator>
      <dc:date>2021-07-03T05:33:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751860#M236751</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;By default SAS writes missing numerical values as a dot. Normally when exporting data to an Excel you want the cell just to be empty.&lt;/P&gt;
&lt;P&gt;If you use statement&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;options missing=' ';&lt;/EM&gt;&lt;/STRONG&gt; prior to the step writing to the Excel as already proposed by&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/332520"&gt;@djh&lt;/a&gt;&amp;nbsp;then you'll get these empty cells in Excel.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;A SQL case statement allows you to set a value based on a condition. This would only be useful to you if you would want to change the value for a specific column like changing missing values to 9999.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 06:58:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751860#M236751</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-03T06:58:07Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751866#M236755</link>
      <description>I handled with not missing(variable name)&lt;BR /&gt;I appreciate your help. &lt;BR /&gt;Now it gives another error as:&lt;BR /&gt;Error: Result of when clause 8 is not the same data types as the preceding results.&lt;BR /&gt;Thanks,&lt;BR /&gt;blue blue</description>
      <pubDate>Sat, 03 Jul 2021 06:10:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751866#M236755</guid>
      <dc:creator>GN0001</dc:creator>
      <dc:date>2021-07-03T06:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751870#M236759</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All the condition results shoule with same variable type.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    select somking_status
           ,case smoking_status
                when "Non-smoker"  then "1"
                when "Light (1-5)" then 2
            end as smoking_cat
    from sashelp.heart
    ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;The above code get same error,&amp;nbsp; one result &lt;STRONG&gt;"1"&amp;nbsp;&lt;/STRONG&gt; is charactet but another result&amp;nbsp; &lt;STRONG&gt;2&amp;nbsp;&lt;/STRONG&gt; is numberic.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try to change these result with same type.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 07:17:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751870#M236759</guid>
      <dc:creator>djh</dc:creator>
      <dc:date>2021-07-03T07:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751872#M236761</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    select Smoking_Status
           ,case Smoking_Status
                when "Non-smoker"  then 1
                when "Light (1-5)" then 2
            end as smoking_cat
    from sashelp.heart
    ;
quit;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Update a typo and the right code&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 07:22:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751872#M236761</guid>
      <dc:creator>djh</dc:creator>
      <dc:date>2021-07-03T07:22:29Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751875#M236762</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/332520"&gt;@djh&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Always formulate an ELSE case to avoid below SAS Note.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_1-1625297536509.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/60923iFE86B75B3BEECA59/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Patrick_1-1625297536509.png" alt="Patrick_1-1625297536509.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Even though it's just a note always formulating an ELSE condition is just good practice.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 07:33:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751875#M236762</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2021-07-03T07:33:28Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751876#M236763</link>
      <description>&lt;P&gt;Thanks for point this&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 07:42:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/751876#M236763</guid>
      <dc:creator>djh</dc:creator>
      <dc:date>2021-07-03T07:42:19Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/752000#M236820</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;- I'm suggesting you use a WHERE clause instead of CASE, not both together.&lt;/P&gt;</description>
      <pubDate>Sun, 04 Jul 2021 20:17:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/752000#M236820</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2021-07-04T20:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: Is not missing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/752059#M236839</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/202329"&gt;@GN0001&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;I handled with not missing(variable name)&lt;BR /&gt;I appreciate your help. &lt;BR /&gt;Now it gives another error as:&lt;BR /&gt;Error: Result of when clause 8 is not the same data types as the preceding results.&lt;BR /&gt;Thanks,&lt;BR /&gt;blue blue&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Post the &lt;STRONG&gt;EXACT&lt;/STRONG&gt; and &lt;STRONG&gt;COMPLETE&lt;/STRONG&gt; log of your PROC SQL step. Use this button for posting the log:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/54552i914D97BE1B0F21E5/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" alt="Bildschirmfoto 2020-04-07 um 08.32.59.jpg" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 11:39:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Is-not-missing/m-p/752059#M236839</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-07-05T11:39:08Z</dc:date>
    </item>
  </channel>
</rss>

