<?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: Simply the coding -- Ether A/B/C is positive? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/665964#M199198</link>
    <description>&lt;P&gt;If I understand the condition right then you want to exclude the case where&amp;nbsp;&lt;EM&gt;FluAsub1 = 1 and FluAsub2 = 1&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and NOT (FluAsub1 = 1 and FluAsub2 = 1)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or as a boolean expression (assuming these are flags with either 1 or 0)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and not (FluAsub1 and FluAsub2)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and (not FluAsub1 or not FluAsub2)&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 30 Jun 2020 01:09:42 GMT</pubDate>
    <dc:creator>Patrick</dc:creator>
    <dc:date>2020-06-30T01:09:42Z</dc:date>
    <item>
      <title>Simply the coding -- Ether A/B/C is positive?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/665932#M199182</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I have codes shown as below,&amp;nbsp; I am wondering if I could simply the WHERE condition better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
	create table lab&amp;amp;rr as
 	select studysite,caseid,PCR,H3N2,FluA,FluAH1,FluAsub1,FluAsub2  
 	from ds3	
	where PCR = 1 and (H3N2 = 1 or FluA = 1 or FluAH1 =1)  
		and ((FluAsub2 ne 1 and FluAsub1 ne 1) or (FluAsub2 = 1 and FluAsub1 = 0)  or (FluAsub2 = 0 and FluAsub1 = 1) )
 	order by studysite,caseid;&lt;/PRE&gt;
&lt;P&gt;I feel the coding&amp;nbsp;which is&amp;nbsp;looking for either FluAsub1 or FluAsub2 is positive, is kind of long.&amp;nbsp; I am not sure if there is a better way to write it.&amp;nbsp; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;PRE&gt;(FluAsub2 ne 1 and FluAsub1 ne 1) or (FluAsub2 = 1 and FluAsub1 = 0)  or (FluAsub2 = 0 and FluAsub1 = 1)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 21:53:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/665932#M199182</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2020-06-29T21:53:55Z</dc:date>
    </item>
    <item>
      <title>Re: Simply the coding -- Ether A/B/C is positive?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/665935#M199185</link>
      <description>&lt;P&gt;How about&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;FluAsub2 + FluAsub1 &amp;lt; 2&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 10:36:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/665935#M199185</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-06-30T10:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Simply the coding -- Ether A/B/C is positive?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/665937#M199187</link>
      <description>&lt;PRE&gt;(FluAsub2 ne 1 and FluAsub1 ne 1) or (FluAsub2 = 1 and FluAsub1 = 0)  or (FluAsub2 = 0 and FluAsub1 = 1)&lt;/PRE&gt;
&lt;P&gt;I get the last two of those conditions since either can be 1, should the first condition be ne though? Are you looking for either = 0 or either&amp;nbsp; = 1? Typically it's 1, which means that should be eq not ne in the first condition?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You're either looking for:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;not(fluAsub2 or fluAsub1)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;or&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;(fluAsub2 or fluAsub1)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Jun 2020 22:08:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/665937#M199187</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2020-06-29T22:08:03Z</dc:date>
    </item>
    <item>
      <title>Re: Simply the coding -- Ether A/B/C is positive?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/665964#M199198</link>
      <description>&lt;P&gt;If I understand the condition right then you want to exclude the case where&amp;nbsp;&lt;EM&gt;FluAsub1 = 1 and FluAsub2 = 1&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and NOT (FluAsub1 = 1 and FluAsub2 = 1)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or as a boolean expression (assuming these are flags with either 1 or 0)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and not (FluAsub1 and FluAsub2)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;or...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;and (not FluAsub1 or not FluAsub2)&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 30 Jun 2020 01:09:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/665964#M199198</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2020-06-30T01:09:42Z</dc:date>
    </item>
    <item>
      <title>Re: Simply the coding -- Ether A/B/C is positive?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/666011#M199218</link>
      <description>&lt;P&gt;That depends.&lt;/P&gt;
&lt;P&gt;If your variables can only be 1 or 0, it can be simplified, e.g. to "not (&lt;SPAN&gt;FluAsub1 and FluAsub2)". &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;But if your code is written like that because one or both of them can be e.g. 8, -2342 or perhaps missing, then probably not.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 30 Jun 2020 08:37:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Simply-the-coding-Ether-A-B-C-is-positive/m-p/666011#M199218</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2020-06-30T08:37:14Z</dc:date>
    </item>
  </channel>
</rss>

