<?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 Excluding observations that are not part of all datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Excluding-observations-that-are-not-part-of-all-datasets/m-p/579072#M164331</link>
    <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;I'm currently working with 6 datasets with ID for each observation and realized that there are observations that are missing in some datasets. For example, ID #7, 24, etc are part of datasets 1, 5, and 6 but not 2, 3, and 4. I would like to write a code that would get rid of these observations so that I would be able to run proc panel without getting the error message "Not enough observations with non-missing values for model statement ... "&lt;/P&gt;&lt;P&gt;Here is the merge code that I have tried so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA merged;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;merge set1 (in = a)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set2 (in = b)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set3 (in = c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set4 (in = d)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set5 (in = e)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set6 (in = f);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; by ID;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if not (a and b and c and d and e and f) then delete;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This has given me error messages written above for observations that are part of all dataset and have no missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not very familiar with proc sql so if there is anyone that can give me a solution to this without using proc sql I would greatly appreciate it. I'm working with SAS 9.4.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Aug 2019 06:11:57 GMT</pubDate>
    <dc:creator>hwkim286</dc:creator>
    <dc:date>2019-08-05T06:11:57Z</dc:date>
    <item>
      <title>Excluding observations that are not part of all datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excluding-observations-that-are-not-part-of-all-datasets/m-p/579072#M164331</link>
      <description>&lt;P&gt;Hello all.&lt;/P&gt;&lt;P&gt;I'm currently working with 6 datasets with ID for each observation and realized that there are observations that are missing in some datasets. For example, ID #7, 24, etc are part of datasets 1, 5, and 6 but not 2, 3, and 4. I would like to write a code that would get rid of these observations so that I would be able to run proc panel without getting the error message "Not enough observations with non-missing values for model statement ... "&lt;/P&gt;&lt;P&gt;Here is the merge code that I have tried so far.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DATA merged;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;merge set1 (in = a)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set2 (in = b)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set3 (in = c)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set4 (in = d)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set5 (in = e)&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; set6 (in = f);&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; by ID;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; if not (a and b and c and d and e and f) then delete;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This has given me error messages written above for observations that are part of all dataset and have no missing values.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am not very familiar with proc sql so if there is anyone that can give me a solution to this without using proc sql I would greatly appreciate it. I'm working with SAS 9.4.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 06:11:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excluding-observations-that-are-not-part-of-all-datasets/m-p/579072#M164331</guid>
      <dc:creator>hwkim286</dc:creator>
      <dc:date>2019-08-05T06:11:57Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding observations that are not part of all datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excluding-observations-that-are-not-part-of-all-datasets/m-p/579073#M164332</link>
      <description>&lt;P&gt;Welcome to the community!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the log complains about anything, posting the log seems to be a good idea. Also note that code and log are best posted by using the {i}-icon to preserve formatting.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Aug 2019 06:20:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excluding-observations-that-are-not-part-of-all-datasets/m-p/579073#M164332</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2019-08-05T06:20:02Z</dc:date>
    </item>
    <item>
      <title>Re: Excluding observations that are not part of all datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Excluding-observations-that-are-not-part-of-all-datasets/m-p/579074#M164333</link>
      <description>&lt;P&gt;A match in the datasets can still contain missing values. You need to get a clear picture of your data first.&lt;/P&gt;
&lt;P&gt;If your data step merge completes without ERROR/WARNING/other suspicious NOTEs, but you still have lots of missings, you have to investigate your source data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS it's simpler to use a subsetting if:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if a and b and c and d and e and f;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 05 Aug 2019 06:28:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Excluding-observations-that-are-not-part-of-all-datasets/m-p/579074#M164333</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-08-05T06:28:26Z</dc:date>
    </item>
  </channel>
</rss>

