<?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: Why does this program shrink the sample size and what is the correct alternative? in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197079#M4335</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your where condition excludes certain records where values are missing, so the dataset size will shrink if such missing values are present. Works as designed.&lt;/P&gt;&lt;P&gt;If you don't want to shrink the dataset, omit the where clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Apr 2015 07:31:57 GMT</pubDate>
    <dc:creator>Kurt_Bremser</dc:creator>
    <dc:date>2015-04-16T07:31:57Z</dc:date>
    <item>
      <title>Why does this program shrink the sample size and what is the correct alternative?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197076#M4332</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;After running this program:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp; set temp; where VAR1 ne . and VAR2 ne .;&lt;/P&gt;&lt;P&gt;VAR3 = VAR1 - VAR2; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the dataset temp only consists of observations where VAR1 and VAR2 have non-missing values. But my intention is just to generate VAR3 with valid values (i.e., if we include missing VAR1 or VAR2 in the calculation, the generated VAR3 will be missing as well).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So as the title says, why does this program shrink the sample size and what is the correct alternative?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 05:15:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197076#M4332</guid>
      <dc:creator>NonSleeper</dc:creator>
      <dc:date>2015-04-16T05:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this program shrink the sample size and what is the correct alternative?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197077#M4333</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You should use WHERE ALSO condition, where can check only one condition. you program should be&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TEMP;&lt;/P&gt;&lt;P&gt;SET TEMP;&lt;/P&gt;&lt;P&gt;WHERE VAR1 NE .;&lt;/P&gt;&lt;P&gt;WHERE ALSO VAR2 NE .;&lt;/P&gt;&lt;P&gt;VAR3 = VAR1 - VAR2;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As your code deletes missings values in VAR1 only, missing values in VAR2 will be retained, so you might ended up with missing values in VAR2, this results missing values in VAR3 as well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="http://www.sascommunity.org/wiki/Where_also" title="http://www.sascommunity.org/wiki/Where_also"&gt;Where also - sasCommunity&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 05:24:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197077#M4333</guid>
      <dc:creator>Subbarao</dc:creator>
      <dc:date>2015-04-16T05:24:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this program shrink the sample size and what is the correct alternative?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197078#M4334</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I run WHERE ALSO but for some reason the result is the same.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 06:43:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197078#M4334</guid>
      <dc:creator>NonSleeper</dc:creator>
      <dc:date>2015-04-16T06:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this program shrink the sample size and what is the correct alternative?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197079#M4335</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your where condition excludes certain records where values are missing, so the dataset size will shrink if such missing values are present. Works as designed.&lt;/P&gt;&lt;P&gt;If you don't want to shrink the dataset, omit the where clause.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 07:31:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197079#M4335</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-04-16T07:31:57Z</dc:date>
    </item>
    <item>
      <title>Re: Why does this program shrink the sample size and what is the correct alternative?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197080#M4336</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I would use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;DATA TEMP;&lt;/P&gt;&lt;P&gt;SET TEMP;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WHERE VAR1 NE . and&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; VAR2 NE .;&lt;/P&gt;&lt;P&gt;VAR3 = VAR1 - VAR2;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;P&gt;if you have any missing values this will most definitely shrink your output compared to the input,&lt;/P&gt;&lt;P&gt;depending on your needs you may be able to use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data temp2;&lt;/P&gt;&lt;P&gt;set temp;&lt;/P&gt;&lt;P&gt;var3 = coalesce(var1,0)-coalesce(var2,0;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Apr 2015 11:12:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Why-does-this-program-shrink-the-sample-size-and-what-is-the/m-p/197080#M4336</guid>
      <dc:creator>Steelers_In_DC</dc:creator>
      <dc:date>2015-04-16T11:12:06Z</dc:date>
    </item>
  </channel>
</rss>

