<?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: Missing observations in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923440#M41419</link>
    <description>&lt;P&gt;If there is a common ID variable (such as customer ID or patient ID or similar), you can merge the two data sets and see which observations don't line up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table combined as select
        coalesce(a.id,b.id) as id
        ,a.variable as variable_in_a
        ,b.variable as variable_in_b
    from dataset_a as a full join dataset_b as b
    on a.id=b.id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then it is easy to search this data set (or use a WHERE clause in the above SQL) for observations that are missing values in either dataset_a or dataset_b.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would be wise to provide sample data along with your explanation; we really can't write code for your situation without sample data. Sample data should be provided as working SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;).&lt;/P&gt;</description>
    <pubDate>Mon, 08 Apr 2024 16:53:07 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2024-04-08T16:53:07Z</dc:date>
    <item>
      <title>Missing observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923436#M41417</link>
      <description>&lt;P&gt;I've got two datasets that are similar. I've run frequency counts for the same variable, however I noticed that one dataset has two less observations. What's the best way/approach to identify what those two observations that are missing from the other data set are?&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 16:34:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923436#M41417</guid>
      <dc:creator>shami</dc:creator>
      <dc:date>2024-04-08T16:34:26Z</dc:date>
    </item>
    <item>
      <title>Re: Missing observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923440#M41419</link>
      <description>&lt;P&gt;If there is a common ID variable (such as customer ID or patient ID or similar), you can merge the two data sets and see which observations don't line up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;proc sql;
    create table combined as select
        coalesce(a.id,b.id) as id
        ,a.variable as variable_in_a
        ,b.variable as variable_in_b
    from dataset_a as a full join dataset_b as b
    on a.id=b.id;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then it is easy to search this data set (or use a WHERE clause in the above SQL) for observations that are missing values in either dataset_a or dataset_b.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You would be wise to provide sample data along with your explanation; we really can't write code for your situation without sample data. Sample data should be provided as working SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;).&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 16:53:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923440#M41419</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-08T16:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Missing observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923444#M41420</link>
      <description>&lt;P&gt;I merged the dataset with the following code by the patient ID:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data raw3;&lt;BR /&gt;merge raw1 raw2;&lt;BR /&gt;by patient_local_id;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not sure how I'd code after this to get the missing observations...&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 16:57:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923444#M41420</guid>
      <dc:creator>shami</dc:creator>
      <dc:date>2024-04-08T16:57:21Z</dc:date>
    </item>
    <item>
      <title>Re: Missing observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923445#M41421</link>
      <description>&lt;P&gt;You can just look at data set RAW3 in a viewer (such as viewtable) and scroll up and down to find missing observations. Or you can do a PROC PRINT with a WHERE statement to print only observations that are missing some values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/437174"&gt;@shami&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data raw3;&lt;BR /&gt;merge raw1 raw2;&lt;BR /&gt;by patient_local_id;&lt;/P&gt;
&lt;P&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Unless the variable names are different in RAW1 and RAW2, or you force them to be different, this won't work.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 17:03:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923445#M41421</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-04-08T17:03:59Z</dc:date>
    </item>
    <item>
      <title>Re: Missing observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923518#M41426</link>
      <description>&lt;P&gt;The in= option lets you capture which source table contributes data to the target table.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data raw3;
  merge raw1(in=in1) raw2(in=in2);
  by patient_local_id;
  if in1=0 or in2=0 then
    do;
      in_raw1=in1;
      in_raw2=in2;
      output;
    end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Apr 2024 23:19:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923518#M41426</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2024-04-08T23:19:21Z</dc:date>
    </item>
    <item>
      <title>Re: Missing observations</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923679#M41427</link>
      <description>Thank you this is helpful</description>
      <pubDate>Tue, 09 Apr 2024 22:23:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Missing-observations/m-p/923679#M41427</guid>
      <dc:creator>shami</dc:creator>
      <dc:date>2024-04-09T22:23:58Z</dc:date>
    </item>
  </channel>
</rss>

