<?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: Treat Missing values as largest possible values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320998#M70791</link>
    <description>&lt;P&gt;If you are concerned that when you code a condition like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(A &amp;lt;= 0.5)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That missing values of A cause the condition to be true then just change your condition to account for missing values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(.Z &amp;lt; A &amp;lt;= 0.5)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(A &amp;lt;= 0.5 and not missing(A))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your specific example you could just remove the ABS() function and code the positive and negative ranges.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;-0.5 &amp;lt;= (A3-B3) &amp;lt;= 0.05 &lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 23 Dec 2016 19:49:08 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2016-12-23T19:49:08Z</dc:date>
    <item>
      <title>Treat Missing values as largest possible values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320961#M70776</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to join two datasets A and B. While joining the two datasets I am applying the follwoing conditions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if (A1=B1) AND (A2=B2) AND (ABS(A3-B3) LE 0.05 OR ABS(A4-B4) LE 0.05)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in the above condition, if&amp;nbsp; either A3,B3,A4,B4 becomes equal to missing values. the result of the condition ((ABS(A3-B3) LE 0.05 OR ABS(A4-B4) LE 0.05)) always becomes . and always less than 0.05&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is there any way to treat missing values as largest possible numbers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance,&lt;/P&gt;
&lt;P&gt;Sheeba Swaminathan&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 16:08:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320961#M70776</guid>
      <dc:creator>Sheeba</dc:creator>
      <dc:date>2016-12-23T16:08:47Z</dc:date>
    </item>
    <item>
      <title>Re: Treat Missing values as largest possible values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320965#M70777</link>
      <description>&lt;P&gt;if you use the sum function instead of the plain math, the missing value is handled differently&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;for example&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data temp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; a = .;&lt;/P&gt;&lt;P&gt;&amp;nbsp; b= 5;&lt;/P&gt;&lt;P&gt;&amp;nbsp; c=sum(a,-b); &amp;nbsp;/* c evaluates to -5 */&lt;/P&gt;&lt;P&gt;&amp;nbsp; d = a-b; &amp;nbsp;/* d evaluates to missing */&lt;/P&gt;&lt;P&gt;run; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;if (A1=B1) AND (A2=B2) AND (ABS(SUM(A3,-B3)) LE 0.05 OR ABS(SUM(A4,-B4)) LE 0.05)&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 16:57:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320965#M70777</guid>
      <dc:creator>TMiles</dc:creator>
      <dc:date>2016-12-23T16:57:41Z</dc:date>
    </item>
    <item>
      <title>Re: Treat Missing values as largest possible values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320968#M70778</link>
      <description>&lt;P&gt;Do A3 and B3 or A4 and B4 ever both have missing values? If so you may have to add some additional levels of comparison such as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;( ( ABS(A3-B3) LE 0.05)&amp;nbsp;and not ( missing(A3) and Missing(B3) ) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;but more details such as actual values and the desired results may be needed. Some time it may be better to subset some of the data in easier chunks and then recombine.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 17:10:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320968#M70778</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2016-12-23T17:10:15Z</dc:date>
    </item>
    <item>
      <title>Re: Treat Missing values as largest possible values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320971#M70780</link>
      <description>&lt;P&gt;Hi Tmiles,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for the reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am worried about the situation where both are missing values. In this case sum function again will evaluate to 0 and again it will become less than 0.05&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I modified the condition to the following&amp;nbsp; to handle the missing values by adding zero to each but again if both A4,B4 turns out to missing . this will result in zero and will become less than 0.05.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;if (A1=B1) AND (A2=B2) AND &lt;/SPAN&gt;&lt;SPAN&gt;(abs(sum(A3,0) - sum(B3,0)) le 0.05)&amp;nbsp;or &amp;nbsp;(abs(sum(A4,0) - sum(B4,0)) le .05)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;sheeba&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 17:32:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320971#M70780</guid>
      <dc:creator>Sheeba</dc:creator>
      <dc:date>2016-12-23T17:32:08Z</dc:date>
    </item>
    <item>
      <title>Re: Treat Missing values as largest possible values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320972#M70781</link>
      <description>&lt;P&gt;Hi Ballardw,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks a lot for the reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;right now the situation of getting missing values in both the columns doesnt exist but i would like to make modifications to the code to handle such situations as well. tnx a lot for the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also i will consider subsetting the data to filter out this conditions.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks again,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sheeba&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 17:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320972#M70781</guid>
      <dc:creator>Sheeba</dc:creator>
      <dc:date>2016-12-23T17:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Treat Missing values as largest possible values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320974#M70782</link>
      <description>&lt;P&gt;You could always check for missing values prior to the subsetting IF and set to a default value. THis will only help if only 1 side of the equation is missing.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it safe to assume if both sides of the equation are missing you want to handle the condition differently? &amp;nbsp;If so perhaps If Then Else logic would get you thru it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;something like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if sum(a3,b3,a4,b4) &amp;gt; 0 then do;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; if (A1=B1) AND (A2=B2) AND (ABS(SUM(A3,-B3)) LE 0.05 OR ABS(SUM(A4,-B4)) LE 0.05)&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;then ??;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;else do;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; ???&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;end;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 17:45:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320974#M70782</guid>
      <dc:creator>TMiles</dc:creator>
      <dc:date>2016-12-23T17:45:25Z</dc:date>
    </item>
    <item>
      <title>Re: Treat Missing values as largest possible values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320978#M70785</link>
      <description>&lt;P&gt;Hi Tmiles,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks for the quick reply.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes. I wouldnt want the match if both are missing values. Also I am populating this conditions dynamically .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will try this out.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Sheeba&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2016 18:14:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320978#M70785</guid>
      <dc:creator>Sheeba</dc:creator>
      <dc:date>2016-12-23T18:14:17Z</dc:date>
    </item>
    <item>
      <title>Re: Treat Missing values as largest possible values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320998#M70791</link>
      <description>&lt;P&gt;If you are concerned that when you code a condition like&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(A &amp;lt;= 0.5)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;That missing values of A cause the condition to be true then just change your condition to account for missing values.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(.Z &amp;lt; A &amp;lt;= 0.5)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(A &amp;lt;= 0.5 and not missing(A))&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In your specific example you could just remove the ABS() function and code the positive and negative ranges.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;-0.5 &amp;lt;= (A3-B3) &amp;lt;= 0.05 &lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 23 Dec 2016 19:49:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/320998#M70791</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2016-12-23T19:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: Treat Missing values as largest possible values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/321321#M70922</link>
      <description>&lt;P&gt;Hi Tom,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Tnx a lot for the suggestions. This is really helpful.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;sheeba .&lt;/P&gt;</description>
      <pubDate>Tue, 27 Dec 2016 19:20:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Treat-Missing-values-as-largest-possible-values/m-p/321321#M70922</guid>
      <dc:creator>Sheeba</dc:creator>
      <dc:date>2016-12-27T19:20:38Z</dc:date>
    </item>
  </channel>
</rss>

