<?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: Exclude observations w/ missing values in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373748#M89414</link>
    <description>&lt;P&gt;try nmiss for multiple variables with missing values&lt;BR /&gt;&lt;A href="http://www2.sas.com/proceedings/sugi31/025-31.pdf" target="_self"&gt;MISSING! - Understanding and Making the Most of Missing Data &lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jul 2017 19:10:31 GMT</pubDate>
    <dc:creator>Miracle</dc:creator>
    <dc:date>2017-07-06T19:10:31Z</dc:date>
    <item>
      <title>Exclude observations w/ missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373744#M89413</link>
      <description>&lt;P&gt;What's the most efficient way to exclude observations w/ missing values for multiple variables in a dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I want to do something like this in my DATA step, but I get errors:&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;		WHERE NOT MISSING (SEQN);
		WHERE SAME AND NOT MISSING (DUQ:);&lt;/PRE&gt;
&lt;P&gt;There are 11 variables w/ a prefix of DUQ. I only want to include the observations that do NOT have missing values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 18:52:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373744#M89413</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2017-07-06T18:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude observations w/ missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373748#M89414</link>
      <description>&lt;P&gt;try nmiss for multiple variables with missing values&lt;BR /&gt;&lt;A href="http://www2.sas.com/proceedings/sugi31/025-31.pdf" target="_self"&gt;MISSING! - Understanding and Making the Most of Missing Data &lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 19:10:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373748#M89414</guid>
      <dc:creator>Miracle</dc:creator>
      <dc:date>2017-07-06T19:10:31Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude observations w/ missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373751#M89415</link>
      <description>&lt;P&gt;Thanks but I think the nmiss function "returns the number of missing values within a list of variables defined." Am I mistaken?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I don't want to count them, I want to exclude them. I want the final dataset to include only those observations with complete data...&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 19:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373751#M89415</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2017-07-06T19:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude observations w/ missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373754#M89416</link>
      <description>&lt;P&gt;It must be documented somewhere, but I'm finding in limited testing that variable lists cannot be used in a WHERE statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can easily run this in a DATA step:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;nm = nmiss(of duq: , seqn);&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But you can't use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where nmiss(of duq: , seqn) = 0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For what it's worth, you could add the variable NM to your data set (using the formula above), and later use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where nm = 0;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Or you could spell out all the names:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where nmiss(duq_01, duquess, duq_abc, seqn) = 0;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 19:28:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373754#M89416</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-07-06T19:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude observations w/ missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373758#M89417</link>
      <description>&lt;P&gt;You cannot use variable lists in WHERE statements. But you can use them in IF statement or a subsetting IF statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want ;
  set have ;
  if nmiss(of SEQN DUQ:) then delete;
 ...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jul 2017 19:45:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/373758#M89417</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2017-07-06T19:45:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude observations w/ missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/375117#M89902</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/4954"&gt;@Astounding&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I like this approach, b/c it will allow me to run PROCs on datasets w/ complete information as well as on datasets w/o complete information. But I don't totally understand it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;nm = nmiss(of duq: , seqn);&amp;gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is this supposed to create a new variable - nm - that has a value of 0 when the value of duq: or seqn is NOT missing? All the values of nm are 0 when I run this...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data want;&lt;/P&gt;
&lt;P&gt;Set have;&lt;/P&gt;
&lt;P&gt;where nm = 0 (i.e. Not missing);&lt;/P&gt;
&lt;P&gt;Run;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 20:25:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/375117#M89902</guid>
      <dc:creator>_maldini_</dc:creator>
      <dc:date>2017-07-11T20:25:37Z</dc:date>
    </item>
    <item>
      <title>Re: Exclude observations w/ missing values</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/375131#M89904</link>
      <description>&lt;P&gt;Yes, NM is a new variable that counts the number of missing values for all those variables combined:&amp;nbsp; all the DUQ: variables, as well as SEQN.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your later use of the WHERE statement is correct.&amp;nbsp; To get only observations with no missing values in that key set of variables:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where NM=0;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jul 2017 21:01:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Exclude-observations-w-missing-values/m-p/375131#M89904</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2017-07-11T21:01:04Z</dc:date>
    </item>
  </channel>
</rss>

