<?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: Missing/Null Data deleted from Tables in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519985#M140948</link>
    <description>&lt;P&gt;How is it a "quirk"?&amp;nbsp; If you have the character string "E" and the character string "" which is missing, how are they the same?&amp;nbsp; Therefore a clause which states is "E"="" is obviously false, and thus the record gets removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: I just saw your latest post.&amp;nbsp; If you want to do it like that then simply:&lt;/P&gt;
&lt;PRE&gt;where not(xy_ind="E");&lt;/PRE&gt;
&lt;P&gt;I.e. if xy_ind=E then don't output.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Dec 2018 15:25:05 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2018-12-10T15:25:05Z</dc:date>
    <item>
      <title>Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519973#M140943</link>
      <description>&lt;P&gt;I'm not sure if this is the correct board, if not can someone tell me where the appropriate board would be.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It has recently come to my attention when I use a negation statement missing/null values are unintentionally also removed from the data table. While for some projects this isn't a problem it is for others.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example if I say &lt;FONT color="#0000FF"&gt;where&lt;/FONT&gt; &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;XYZ_IND ^= "E"&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Both the "E" values and missing/null values are removed from my data table. In one instance missing/null values are VALID.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something with my SAS setup or is it a quirk of SAS?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;AggieGal&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:08:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519973#M140943</guid>
      <dc:creator>AggieGal</dc:creator>
      <dc:date>2018-12-10T15:08:58Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519976#M140944</link>
      <description>&lt;P&gt;A missing value is ^= "E"&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;perhaps you want&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where xyz_ind^="E" and not missing(xyz_ind)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:15:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519976#M140944</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-10T15:15:09Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519981#M140946</link>
      <description>&lt;P&gt;The problem is there are other indicators. It is just the "E"s that shouldn't be counted.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Ultimately I did an INCLUSIVE where statement to include blanks " " and missing since they are coded separately in the data.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:17:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519981#M140946</guid>
      <dc:creator>AggieGal</dc:creator>
      <dc:date>2018-12-10T15:17:27Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519982#M140947</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/25236"&gt;@AggieGal&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The problem is there are other indicators. It is just the "E"s that shouldn't be counted.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Ultimately I did an INCLUSIVE where statement to include blanks " " and missing since they are coded separately in the data.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;You have given an extremely fragmentary description of the problem. So I'm not clear what you are saying or what you did.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:21:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519982#M140947</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-10T15:21:07Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519985#M140948</link>
      <description>&lt;P&gt;How is it a "quirk"?&amp;nbsp; If you have the character string "E" and the character string "" which is missing, how are they the same?&amp;nbsp; Therefore a clause which states is "E"="" is obviously false, and thus the record gets removed.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: I just saw your latest post.&amp;nbsp; If you want to do it like that then simply:&lt;/P&gt;
&lt;PRE&gt;where not(xy_ind="E");&lt;/PRE&gt;
&lt;P&gt;I.e. if xy_ind=E then don't output.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:25:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519985#M140948</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-10T15:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519989#M140951</link>
      <description>&lt;P&gt;That's the thing they aren't the same by any stretch of the imagination.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I tell SAS &lt;STRONG&gt;&lt;FONT color="#FF0000"&gt;^= "E"&lt;/FONT&gt;&lt;/STRONG&gt; the missing/null values are &lt;STRONG&gt;&lt;FONT color="#993366"&gt;ALSO&lt;/FONT&gt;&lt;/STRONG&gt; being removed. I just need the E's removed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to figure out if it is an annoying quirk in SAS or if there is something with my SAS setup.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:25:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519989#M140951</guid>
      <dc:creator>AggieGal</dc:creator>
      <dc:date>2018-12-10T15:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519992#M140952</link>
      <description>&lt;P&gt;No its not a quirk, it is simple logic.&amp;nbsp; E does not equal missing, nor does it equal null, nor does it equal A, b, 1, 2, =, or ! or any other character.&amp;nbsp; Therefore you logic states, where something is not equal to E, means anything which is not E is dropped.&amp;nbsp; There is nothing wrong with your setup, there is no quirk in SAS.&amp;nbsp; It is just following what you have told it to do.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:28:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519992#M140952</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-12-10T15:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519993#M140953</link>
      <description>&lt;P&gt;Still seems like my code in&amp;nbsp;message #2 does what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As far as the possibility that this is a quirk, I'd advise against that thought process, SAS is doing exactly what you asked it to do (and as far as I know, all programming languages would behave the same).&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:29:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519993#M140953</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-10T15:29:56Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519995#M140954</link>
      <description>&lt;P&gt;As far as I know when I say I want EVERYTHING but one thing, EVERYTHING but the one thing should be included in the data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Take the following&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;XYZ_IND can equal A, B, C, D, E, F, (etc), " " (bank), or missing/null.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I tell SAS Where XYZ_IND ^= "E" I should get all the above BUT E. However the missing/null values are ALSO being removed.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is where the hangup is. When I am doing a WHERE CLAUSE the missing/null are being removed in ADDITION to what I don't want. I'm trying to figure out is why this is happening.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:33:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519995#M140954</guid>
      <dc:creator>AggieGal</dc:creator>
      <dc:date>2018-12-10T15:33:36Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519998#M140955</link>
      <description>&lt;P&gt;Please share a small portion of your actual data, as SAS data step code, as indicated at this link:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/How-to-create-a-data-step-version-of-your-data-AKA-generate/ta-p/258712&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also please share your complete code for the data step or PROC where you want this WHERE clause to work.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 15:37:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/519998#M140955</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2018-12-10T15:37:29Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/520031#M140961</link>
      <description>&lt;P&gt;Your expectations are right on target.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The portion of code that you presented looks fine, although this might be clearer to read:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if xyz_ind="E" then delete;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Perhaps the problem lies in some other portion of the code that you have not shared at this point.&amp;nbsp; For example, some procedures automatically throw out missing values of variables that appear in a CLASS statement.&amp;nbsp; But from everything you have posted so far, the results should match what you want (even though we know they do not).&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Dec 2018 16:23:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/520031#M140961</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-12-10T16:23:04Z</dc:date>
    </item>
    <item>
      <title>Re: Missing/Null Data deleted from Tables</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/520298#M141054</link>
      <description>&lt;P&gt;This does not sound like a SAS quirk, but an SQL quirk. Sounds like your data is stored on a non-SAS database. Most SQL databases use a half-hearted kind of three-pronged logic, where comparing NULL to something is kind of undefined (does not matter what operator you use); but "kind of undefined" comes out as "not true". So, even NULL=NULL comes out at "kind of not true", and you have to use the special operator "IS NULL".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SAS has a (I think) more reasonable approach, where a missing value is comparable, and a missing value is considered smaller than any non-missing value.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So if you want to get the result you want, you may have to change your where clause to&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where XYZ_IND^="E" or XYZ_IND is null&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Dec 2018 09:14:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Missing-Null-Data-deleted-from-Tables/m-p/520298#M141054</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2018-12-11T09:14:12Z</dc:date>
    </item>
  </channel>
</rss>

