<?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: Merge output, if a and ^b then output ... in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Merge-output-if-a-and-b-then-output/m-p/557800#M155548</link>
    <description>Thank you! I wanted to know if the caret symbol (^) is read as "not".</description>
    <pubDate>Fri, 10 May 2019 14:55:37 GMT</pubDate>
    <dc:creator>jffeudo86</dc:creator>
    <dc:date>2019-05-10T14:55:37Z</dc:date>
    <item>
      <title>Merge output, if a and ^b then output ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-output-if-a-and-b-then-output/m-p/557618#M155465</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Just wanted to confirm: if a and ^b in "IF a AND ^b THEN OUTPUT ..." can be read as "if in a and not in b", is that correct?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have googled this particular syntax and it doesn't appear in the results.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 21:28:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-output-if-a-and-b-then-output/m-p/557618#M155465</guid>
      <dc:creator>jffeudo86</dc:creator>
      <dc:date>2019-05-09T21:28:36Z</dc:date>
    </item>
    <item>
      <title>Re: Merge output, if a and ^b then output ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-output-if-a-and-b-then-output/m-p/557627#M155469</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/271494"&gt;@jffeudo86&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Just wanted to confirm: if a and ^b in "IF a AND ^b THEN OUTPUT ..." can be read as "if in a and not in b", is that correct?&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have googled this particular syntax and it doesn't appear in the results.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Depends. How did the variables A and B get assigned. By "in" do you mean coming from a data set? Then this would be true only if the dataset option in= was used:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data junk;
   merge 
   one (in=a)
   two (in=b)
   ;
   if a and not b then output;
end;&lt;/PRE&gt;
&lt;P&gt;But "in a" above would mean "in data set one". There is no automatic membership logical&amp;nbsp;variable set based on the source data set.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the question is about the logical structure then there are different ways of doing the "not":&lt;/P&gt;
&lt;PRE&gt;data example;
   input a b;
   z= a and ^b;
   y= a and not b;
   x= a and ~ b;
datalines;
1 1
1 0
0 0
0 1
;
run;&lt;/PRE&gt;
&lt;P&gt;The logical value is the same but not all keyboards use the ~ or ^.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And note that if you only have one data set on the DATA statement so that all of the output is going to that set conditionally then you don't even need the OUTPUT as&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if a and not b;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;is a subsetting if and the records that match the logic are the only ones kept.&lt;/P&gt;</description>
      <pubDate>Thu, 09 May 2019 22:12:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-output-if-a-and-b-then-output/m-p/557627#M155469</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2019-05-09T22:12:53Z</dc:date>
    </item>
    <item>
      <title>Re: Merge output, if a and ^b then output ...</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Merge-output-if-a-and-b-then-output/m-p/557800#M155548</link>
      <description>Thank you! I wanted to know if the caret symbol (^) is read as "not".</description>
      <pubDate>Fri, 10 May 2019 14:55:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Merge-output-if-a-and-b-then-output/m-p/557800#M155548</guid>
      <dc:creator>jffeudo86</dc:creator>
      <dc:date>2019-05-10T14:55:37Z</dc:date>
    </item>
  </channel>
</rss>

