<?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 Detect when numeric varible has all missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777297#M247258</link>
    <description>&lt;P&gt;Hi guys&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to write simple code to check a numeric variable to see if it has all values missing or not and create a macro variable e.g ALLMISS=Y or N.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g.&lt;/P&gt;
&lt;P&gt;NUMVAR&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 29 Oct 2021 14:27:31 GMT</pubDate>
    <dc:creator>kalbo</dc:creator>
    <dc:date>2021-10-29T14:27:31Z</dc:date>
    <item>
      <title>Detect when numeric varible has all missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777297#M247258</link>
      <description>&lt;P&gt;Hi guys&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am trying to write simple code to check a numeric variable to see if it has all values missing or not and create a macro variable e.g ALLMISS=Y or N.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;e.g.&lt;/P&gt;
&lt;P&gt;NUMVAR&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 14:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777297#M247258</guid>
      <dc:creator>kalbo</dc:creator>
      <dc:date>2021-10-29T14:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Detect when numeric varible has all missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777307#M247265</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc summary data=have;
var numvar;
output out=counts n=n;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If N=0 in the output data set named COUNTS, that's what you're looking for.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 14:35:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777307#M247265</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2021-10-29T14:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Detect when numeric varible has all missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777327#M247276</link>
      <description>&lt;P&gt;&lt;A href="https://gist.github.com/statgeek/feedc3fc520cb0d2018ca2a8cab241d8" target="_blank"&gt;https://gist.github.com/statgeek/feedc3fc520cb0d2018ca2a8cab241d8&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 15:28:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777327#M247276</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2021-10-29T15:28:57Z</dc:date>
    </item>
    <item>
      <title>Re: Detect when numeric varible has all missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777369#M247301</link>
      <description>&lt;P&gt;Here is a pretty simple/quick way.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  if eof then call symputx('allmiss'='Y');
  set have(keep=numvar) end=eof;
  where not missing(numvar);
  call symputx('allmiss','N');
  stop;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It will have to scan the whole file to get to YES but only up to the first non missing value to find that the answer is NO.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Oct 2021 17:36:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777369#M247301</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-10-29T17:36:42Z</dc:date>
    </item>
    <item>
      <title>Re: Detect when numeric varible has all missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777390#M247309</link>
      <description>&lt;P&gt;Another approach is to use Proc SQL:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=""&gt;proc sql&amp;nbsp; noprint;
&amp;nbsp; &amp;nbsp; select case when sum(case when numvar is not null then 1 else 0 end) then 'N' else 'Y' end&amp;nbsp; into :allmiss
&amp;nbsp; &amp;nbsp; from have;
quit;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Oct 2021 18:58:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Detect-when-numeric-varible-has-all-missing-values/m-p/777390#M247309</guid>
      <dc:creator>mnatkins</dc:creator>
      <dc:date>2021-10-29T18:58:05Z</dc:date>
    </item>
  </channel>
</rss>

