<?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 do I write  matched and non-matching observations from merged datasets in one program. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/781509#M249061</link>
    <description>&lt;P&gt;data rm nrm(drop=ex:);&lt;BR /&gt;merge dadw(in=a) famx(in=b);&lt;BR /&gt;by id;&lt;/P&gt;&lt;P&gt;if a and b then&lt;BR /&gt;output=rm;&lt;BR /&gt;else output=nrm;&lt;BR /&gt;run;&lt;/P&gt;</description>
    <pubDate>Sun, 21 Nov 2021 00:43:47 GMT</pubDate>
    <dc:creator>pavana1</dc:creator>
    <dc:date>2021-11-21T00:43:47Z</dc:date>
    <item>
      <title>How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676764#M204081</link>
      <description>&lt;P&gt;Hello&lt;/P&gt;&lt;P&gt;&amp;nbsp;How do I write&amp;nbsp;matched and non-matching observations from merged dataset to different new data sets&lt;/P&gt;&lt;P&gt;I am trying to write a single program where I get two data sets; one for the matched, 2nd for the unmatched. Having a problem with the nomatch08 data set.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data results.08 (output=results.nomatch08);&lt;BR /&gt;Merge Books.input08a&lt;BR /&gt;(In=Input08a)&lt;BR /&gt;Books.input08b (In=Input08b);&lt;BR /&gt;By Id;&lt;BR /&gt;If Input08a=1 and Input08b=1; output;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 15:23:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676764#M204081</guid>
      <dc:creator>Toybeck11</dc:creator>
      <dc:date>2020-08-14T15:23:50Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676765#M204082</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data results.match08 
        results.nomatch08;


Merge Books.input08a  (In=Input08a)
          Books.input08b (In=Input08b);

By Id;

If Input08a and Input08b then output results.match08;
else output results.nomatch08;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;1. List both output data sets on the DATA statement - no parenthesis required&lt;/P&gt;
&lt;P&gt;2. Add the OUTPUT to your IF statement and the name of the data set you want it written out to&lt;/P&gt;
&lt;P&gt;3. Fix name of matched data set - names cannot start with a number (results.08 is not a valid SAS data set name).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&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/332276"&gt;@Toybeck11&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hello&lt;/P&gt;
&lt;P&gt;&amp;nbsp;How do I write&amp;nbsp;matched and non-matching observations from merged dataset to different new data sets&lt;/P&gt;
&lt;P&gt;I am trying to write a single program where I get two data sets; one for the matched, 2nd for the unmatched. Having a problem with the nomatch08 data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Data results.08 (output=results.nomatch08);&lt;BR /&gt;Merge Books.input08a&lt;BR /&gt;(In=Input08a)&lt;BR /&gt;Books.input08b (In=Input08b);&lt;BR /&gt;By Id;&lt;BR /&gt;If Input08a=1 and Input08b=1; output;&lt;BR /&gt;run;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 15:28:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676765#M204082</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-14T15:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676790#M204091</link>
      <description>&lt;P&gt;Thanks a lot. It worked.&lt;/P&gt;&lt;P&gt;How do I exclude all variables that begin with "ex" from results.nomatch08? Same program?&lt;/P&gt;&lt;P&gt;Thanks for your help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Data results.matcho8 results.nomatch08;&lt;BR /&gt;Merge&lt;BR /&gt;cert.Input08a (In=Input08a)&lt;BR /&gt;cert.Input08b (In=Input08b);&lt;BR /&gt;By Id;&lt;BR /&gt;If Input08a=1 and Input08b=1 then output results.matcho8;&lt;BR /&gt;else output results.nomatch08;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 16:45:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676790#M204091</guid>
      <dc:creator>Toybeck11</dc:creator>
      <dc:date>2020-08-14T16:45:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676794#M204093</link>
      <description>Only for one data set? Is there a naming convention besides just starting with ex?</description>
      <pubDate>Fri, 14 Aug 2020 16:54:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676794#M204093</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-14T16:54:24Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676802#M204095</link>
      <description>In one of the data sets results.match08, I want to drop all variables with "ex"&lt;BR /&gt;(Exclude all variables that begin with "ex" from results.nomatch08). the last statement is giving error.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Data results.match08 results.nomatch08;&lt;BR /&gt;Merge&lt;BR /&gt;cert.Input08a (In=Input08a)&lt;BR /&gt;cert.Input08b (In=Input08b);&lt;BR /&gt;By Id;&lt;BR /&gt;If Input08a=1 and Input08b=1 then output results.match08;&lt;BR /&gt;else output results.nomatch08; drop='ex:';&lt;BR /&gt;run;</description>
      <pubDate>Fri, 14 Aug 2020 17:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676802#M204095</guid>
      <dc:creator>Toybeck11</dc:creator>
      <dc:date>2020-08-14T17:14:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676818#M204099</link>
      <description>Is there a naming convention besides just starting with ex?&lt;BR /&gt;&lt;BR /&gt;Your DROP statement is incorrect syntax wise. &lt;BR /&gt;You can use the data set options on the DATA statement but I'm not sure that takes wildcards, so if you have another naming convention you may be able to do that or otherwise you need to create that list ahead of time and there are ways. But if you have a naming convention that isn't needed.&lt;BR /&gt;&lt;BR /&gt;So do you have a naming convention besides just ex?&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Aug 2020 17:51:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676818#M204099</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-14T17:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676855#M204107</link>
      <description>No I do not have a naming convention.&lt;BR /&gt;I'm working on a practice exam. this is all the question says:&lt;BR /&gt;a. Combine data sets cert.input08a and cert.input08b by matching values of the ID variable.&lt;BR /&gt;b. Write only observations that are in both data sets to a new data set named results.match08.&lt;BR /&gt;c. Write all other non-matching observations from either data set to a new data set named results.nomatch08.&lt;BR /&gt;o Exclude all variables that begin with "ex" from results.nomatch08.&lt;BR /&gt;</description>
      <pubDate>Fri, 14 Aug 2020 19:34:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676855#M204107</guid>
      <dc:creator>Toybeck11</dc:creator>
      <dc:date>2020-08-14T19:34:53Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676861#M204109</link>
      <description>&lt;P&gt;Here is a reference that illustrates how to refer to variables and datasets in a short cut list:&lt;BR /&gt;&lt;A href="https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html" target="_blank"&gt;https://blogs.sas.com/content/iml/2018/05/29/6-easy-ways-to-specify-a-list-of-variables-in-sas.html&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If none of those work for you then you'll have to dynamically generate the list but that's usually not requirement for the base exam, possibly the advanced one though.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 19:42:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/676861#M204109</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-08-14T19:42:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/689595#M209655</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Data results.match08 results.nomatch08;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Merge&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cert.Input08a (In=Input08a)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;cert.Input08b (In=Input08b);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;By Id;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If Input08a=1 and Input08b=1 then output results.match08;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;else output results.nomatch08; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;drop=ex: ;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;run;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Oct 2020 15:32:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/689595#M209655</guid>
      <dc:creator>SB_15</dc:creator>
      <dc:date>2020-10-07T15:32:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do I write  matched and non-matching observations from merged datasets in one program.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/781509#M249061</link>
      <description>&lt;P&gt;data rm nrm(drop=ex:);&lt;BR /&gt;merge dadw(in=a) famx(in=b);&lt;BR /&gt;by id;&lt;/P&gt;&lt;P&gt;if a and b then&lt;BR /&gt;output=rm;&lt;BR /&gt;else output=nrm;&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Sun, 21 Nov 2021 00:43:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-do-I-write-matched-and-non-matching-observations-from-merged/m-p/781509#M249061</guid>
      <dc:creator>pavana1</dc:creator>
      <dc:date>2021-11-21T00:43:47Z</dc:date>
    </item>
  </channel>
</rss>

