<?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: How to output the observations not merged into the first dataset in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-observations-not-merged-into-the-first-dataset/m-p/683074#M206832</link>
    <description>&lt;PRE&gt;data five other;
   merge four (in=a) 
              LOS2 (keep = ID Admission_date Discharge_date LOS Discharge);
    by ID;
    if a = 1 then output five;
    else output other;
run;&lt;/PRE&gt;
&lt;P&gt;You need to 1) specify another data set on the Data statement, 2) conditionally indicate which specific data set using OUTPUT statements which data set each group of records gets written to.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Sep 2020 20:48:30 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2020-09-10T20:48:30Z</dc:date>
    <item>
      <title>How to output the observations not merged into the first dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-observations-not-merged-into-the-first-dataset/m-p/683070#M206829</link>
      <description>&lt;P&gt;Hi ,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I merged two datasets using the code below. How do I export or output the IDs and observations in "LOS2" dataset that were not merged into "four" dataset?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;data five;&lt;BR /&gt;merge four (in=a) LOS2 (keep = ID Admission_date Discharge_date LOS Discharge);&lt;BR /&gt;by ID;&lt;BR /&gt;if a = 1;&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 20:32:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-observations-not-merged-into-the-first-dataset/m-p/683070#M206829</guid>
      <dc:creator>Denali</dc:creator>
      <dc:date>2020-09-10T20:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to output the observations not merged into the first dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-observations-not-merged-into-the-first-dataset/m-p/683074#M206832</link>
      <description>&lt;PRE&gt;data five other;
   merge four (in=a) 
              LOS2 (keep = ID Admission_date Discharge_date LOS Discharge);
    by ID;
    if a = 1 then output five;
    else output other;
run;&lt;/PRE&gt;
&lt;P&gt;You need to 1) specify another data set on the Data statement, 2) conditionally indicate which specific data set using OUTPUT statements which data set each group of records gets written to.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2020 20:48:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-observations-not-merged-into-the-first-dataset/m-p/683074#M206832</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-09-10T20:48:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to output the observations not merged into the first dataset</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-observations-not-merged-into-the-first-dataset/m-p/683075#M206833</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data five;
merge four (in=a) 
           LOS2 (in = b keep = ID Admission_date Discharge_date LOS Discharge);
by ID;
if b and not a;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 10 Sep 2020 20:48:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-output-the-observations-not-merged-into-the-first-dataset/m-p/683075#M206833</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2020-09-10T20:48:46Z</dc:date>
    </item>
  </channel>
</rss>

