<?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: Instead of MISS()/CMISS(), wanna detect Negative values. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167093#M32186</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, All,&lt;/P&gt;&lt;P&gt;Thanks for your inputs. They all make sense to my situation and some of you even went further to include missing values. I appreciate that.&lt;/P&gt;&lt;P&gt;It looks like there is no existing function to find the negative values directly, however, people find ways to get around. and there are a lot of ways to choose from. &lt;/P&gt;&lt;P&gt;It is definite another learning experience for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 02 Jan 2015 16:57:46 GMT</pubDate>
    <dc:creator>jiangmi</dc:creator>
    <dc:date>2015-01-02T16:57:46Z</dc:date>
    <item>
      <title>Instead of MISS()/CMISS(), wanna detect Negative values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167086#M32179</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input id$ score1 score2 score3;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;A 12 23 0&lt;/P&gt;&lt;P&gt;B 34 -5 41&lt;/P&gt;&lt;P&gt;C -8 56 -9&lt;/P&gt;&lt;P&gt;;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data want;&lt;/P&gt;&lt;P&gt;input id$ score1 score2 score3;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;A 12 23 0&lt;/P&gt;&lt;P&gt;;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need know if any of the variables (score1-score3) contains negative values and delete the obs with any negative value in it.&lt;/P&gt;&lt;P&gt;Now, I can do it with an array. &lt;/P&gt;&lt;P&gt;My question is: initially I was thinking about finding some functions similar to MISS()/CMISS() that will evaluate negative value situation for all the variables at once.&lt;/P&gt;&lt;P&gt;Does anybody know anything about it?&lt;/P&gt;&lt;P&gt;Thank you and Happy New Year.&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 17:51:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167086#M32179</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2014-12-31T17:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: Instead of MISS()/CMISS(), wanna detect Negative values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167087#M32180</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am not aware of any existing function does just that, array() would be a text book approach, but you can also do:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;input&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; id$ score1 score2 score3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; _a=cats(of score:);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;if&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; length(compress(_a,&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: purple; background: white;"&gt;'-'&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;))=length(_a);&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;drop&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt; _a;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="font-family: 'Courier New'; color: blue; background: white;"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;A 12 23 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;B 34 -5 41&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: #FFFFC0;"&gt;C -8 56 -9&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="color: navy; background: white; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Happy New Year!&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-family: 'Courier New'; color: black; background: white;"&gt;Haikuo&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 18:07:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167087#M32180</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2014-12-31T18:07:48Z</dc:date>
    </item>
    <item>
      <title>Re: Instead of MISS()/CMISS(), wanna detect Negative values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167088#M32181</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Or the MIN function. Returns lowest value of listed variables and returns missing ONLY when all are missing.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: navy; font-family: 'Courier New';"&gt;&lt;STRONG&gt;data&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; have;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;input&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; id$ score1 score2 score3;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;if&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt; min(score1,score2,score3)&amp;lt;0 then delete;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;/* if you want to keep the obs when all of the scores are missing, assuming that may happen then&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;&amp;nbsp; if . &amp;lt; min(score1,score2,score3)&amp;lt;0 then delete;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="background: white; color: blue; font-family: 'Courier New';"&gt;cards&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New';"&gt;A 12 23 0&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New';"&gt;B 34 -5 41&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: #ffffc0; color: black; font-family: 'Courier New';"&gt;C -8 56 -9&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background: white; color: navy; font-family: 'Courier New';"&gt;&lt;STRONG&gt;run&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="background: white; color: black; font-family: 'Courier New';"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 31 Dec 2014 18:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167088#M32181</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-12-31T18:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Instead of MISS()/CMISS(), wanna detect Negative values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167089#M32182</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You could also check SIGN() to judge if it is negative.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;data have;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input id $ score1 score2 score3;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s=sign(score1);put score1= s=;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s=sign(score2);put score2= s=;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; s=sign(score3);put score3= s=;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cards;
A 12 23 0
B 34 -5 41
C -8 56 -9
;
run;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Xia Keshan&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jan 2015 07:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167089#M32182</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2015-01-01T07:39:30Z</dc:date>
    </item>
    <item>
      <title>Re: Instead of MISS()/CMISS(), wanna detect Negative values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167090#M32183</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data have;&lt;/P&gt;&lt;P&gt;input id$ score1 score2 score3;&lt;/P&gt;&lt;P&gt;if smallest(1,of score1-score3)&amp;gt;=0;&lt;/P&gt;&lt;P&gt;cards;&lt;/P&gt;&lt;P&gt;A 12 23 0&lt;/P&gt;&lt;P&gt;B 34 -5 41&lt;/P&gt;&lt;P&gt;C -8 56 -9&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jan 2015 18:38:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167090#M32183</guid>
      <dc:creator>stat_sas</dc:creator>
      <dc:date>2015-01-01T18:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Instead of MISS()/CMISS(), wanna detect Negative values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167091#M32184</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Depends if you want to drop the all-missing observations or not :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data have;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;input id$ score1 score2 score3;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if smallest(1, of score1-score3, 1) &amp;gt;= 0;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;if n(of score1-score3) &amp;gt; 0; /* If you want to drop all-missing obs */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cards;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;A 12 23 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;B 34 -5 41&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;C -8 56 -9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;D . . . &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;E . 1 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;F . -1 2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jan 2015 19:55:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167091#M32184</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-01-01T19:55:26Z</dc:date>
    </item>
    <item>
      <title>Re: Instead of MISS()/CMISS(), wanna detect Negative values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167092#M32185</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Consider the simple case - NO values are missing.&lt;/P&gt;&lt;P&gt;Then the simple statement would be&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;where min( of _numeric_) GE 0 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That drops all obs where ANY numeric value is negative&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Jan 2015 20:32:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167092#M32185</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2015-01-01T20:32:28Z</dc:date>
    </item>
    <item>
      <title>Re: Instead of MISS()/CMISS(), wanna detect Negative values.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167093#M32186</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi, All,&lt;/P&gt;&lt;P&gt;Thanks for your inputs. They all make sense to my situation and some of you even went further to include missing values. I appreciate that.&lt;/P&gt;&lt;P&gt;It looks like there is no existing function to find the negative values directly, however, people find ways to get around. and there are a lot of ways to choose from. &lt;/P&gt;&lt;P&gt;It is definite another learning experience for me.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 02 Jan 2015 16:57:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Instead-of-MISS-CMISS-wanna-detect-Negative-values/m-p/167093#M32186</guid>
      <dc:creator>jiangmi</dc:creator>
      <dc:date>2015-01-02T16:57:46Z</dc:date>
    </item>
  </channel>
</rss>

