<?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: sas output options in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/sas-output-options/m-p/108879#M22645</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;There's a difference between getting the NUMBER of non-matching observations and getting the actual non-matching observations in a dataset. Which one do you really want? It almost sounds to me like you are describing (sort of ) the use of the IN= option with a SAS MERGE statement. But even with IN=, you need conditional logic to get the correct observations in the output file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data both_ab only_a only_b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; merge a(in=ina)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b(in=inb); by matchvar;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if ina=1 and inb=1 then output both_ab;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; else if ina=0 and inb=1 then output only_b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; else if ina=1 and inb=0 then output only_a;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code would create 3 data sets..one for the matches, one for the obs in only dataset a and the other for only the obs in dataset b.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you wanted matches in one file and all the nonmatches in a second file, then you would do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data matches nonmatches;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; merge a(in=ina)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b(in=inb); by matchvar;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if ina=1 and inb=1 then output matches;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; else if (ina=0 and inb=1) or (ina=1 and inb=0) then output nonmatches;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then you might be referring to something else entirely. It's not clear to me from your description that you really mean the IN= option. It was just a guess on my part. To review the new features of SAS 9.3, refer to the What's New documentation in the SAS 9.3 doc. It's usually at the very beginning of the documentation, under a separate topic like "What's New in Base SAS 9.3 Procedures" or 'What's New in SAS 9.3 Data Set Options". You can search for those topics in the Help files to find them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 16 Feb 2013 04:35:36 GMT</pubDate>
    <dc:creator>Cynthia_sas</dc:creator>
    <dc:date>2013-02-16T04:35:36Z</dc:date>
    <item>
      <title>sas output options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-output-options/m-p/108878#M22644</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Few weeks ago I saw that SAS has an output option that gives the number of non matching observation and writes them to a dataset.&lt;/P&gt;&lt;P&gt;I can not find the appropraite syntax.&lt;/P&gt;&lt;P&gt;The example given was that if you have dataset A and dataset B and you combine them (using merge or set) with a particular output option you can get the observations that meet your merging criteria in dataset AB1 and the nonmatching observations in datasetABnon without writtne a conditiona if statement.&lt;/P&gt;&lt;P&gt;I just can not find&amp;nbsp; the syntax and am wondering if anyone knows what I am referring to.&lt;/P&gt;&lt;P&gt;Maybe it is a new feature of 9.3.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Kamal&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 13 Feb 2013 20:33:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-output-options/m-p/108878#M22644</guid>
      <dc:creator>Kc2</dc:creator>
      <dc:date>2013-02-13T20:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: sas output options</title>
      <link>https://communities.sas.com/t5/SAS-Programming/sas-output-options/m-p/108879#M22645</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi:&lt;/P&gt;&lt;P&gt;There's a difference between getting the NUMBER of non-matching observations and getting the actual non-matching observations in a dataset. Which one do you really want? It almost sounds to me like you are describing (sort of ) the use of the IN= option with a SAS MERGE statement. But even with IN=, you need conditional logic to get the correct observations in the output file:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data both_ab only_a only_b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; merge a(in=ina)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b(in=inb); by matchvar;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if ina=1 and inb=1 then output both_ab;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; else if ina=0 and inb=1 then output only_b;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; else if ina=1 and inb=0 then output only_a;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The above code would create 3 data sets..one for the matches, one for the obs in only dataset a and the other for only the obs in dataset b.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if you wanted matches in one file and all the nonmatches in a second file, then you would do this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;data matches nonmatches;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; merge a(in=ina)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; b(in=inb); by matchvar;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; if ina=1 and inb=1 then output matches;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;&amp;nbsp; else if (ina=0 and inb=1) or (ina=1 and inb=0) then output nonmatches;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'courier new', courier;"&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But then you might be referring to something else entirely. It's not clear to me from your description that you really mean the IN= option. It was just a guess on my part. To review the new features of SAS 9.3, refer to the What's New documentation in the SAS 9.3 doc. It's usually at the very beginning of the documentation, under a separate topic like "What's New in Base SAS 9.3 Procedures" or 'What's New in SAS 9.3 Data Set Options". You can search for those topics in the Help files to find them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;cynthia&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 16 Feb 2013 04:35:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/sas-output-options/m-p/108879#M22645</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2013-02-16T04:35:36Z</dc:date>
    </item>
  </channel>
</rss>

