<?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: request to know how many and  or can be used with in a single if clause in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/request-to-know-how-many-and-or-can-be-used-with-in-a-single-if/m-p/77072#M22338</link>
    <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
The answer is pretty much as many as you could possibily hope to use. No doubt there is a limit but I've never reached it. If you have a number of ORs or ANDs which gets anywhere near the limit I would suggest you need to code you data step differently.&lt;BR /&gt;
&lt;BR /&gt;
I would however suggest, in the example you give, using the IN operator.&lt;BR /&gt;
&lt;BR /&gt;
e.g.&lt;BR /&gt;
&lt;BR /&gt;
if type in ('a' 'b3' 'a21') then output test1;&lt;BR /&gt;
&lt;BR /&gt;
Hope that helps.</description>
    <pubDate>Tue, 17 Mar 2009 15:11:03 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-03-17T15:11:03Z</dc:date>
    <item>
      <title>request to know how many and  or can be used with in a single if clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/request-to-know-how-many-and-or-can-be-used-with-in-a-single-if/m-p/77071#M22337</link>
      <description>Hi,&lt;BR /&gt;
i would like to know how many and 's  or's we can use in a data step.&lt;BR /&gt;
for example&lt;BR /&gt;
&lt;BR /&gt;
data test1 test2 test3;&lt;BR /&gt;
set soruce;&lt;BR /&gt;
if  type='a' or type= 'b3' or or type='a21' ................ then output test1;&lt;BR /&gt;
  &lt;BR /&gt;
/* loke wise how many or 's can i use  with in a single if clause */&lt;BR /&gt;
&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
thanks in advance&lt;BR /&gt;
&lt;BR /&gt;
sams

Message was edited by: sams1</description>
      <pubDate>Tue, 17 Mar 2009 15:00:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/request-to-know-how-many-and-or-can-be-used-with-in-a-single-if/m-p/77071#M22337</guid>
      <dc:creator>ssas</dc:creator>
      <dc:date>2009-03-17T15:00:16Z</dc:date>
    </item>
    <item>
      <title>Re: request to know how many and  or can be used with in a single if clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/request-to-know-how-many-and-or-can-be-used-with-in-a-single-if/m-p/77072#M22338</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
The answer is pretty much as many as you could possibily hope to use. No doubt there is a limit but I've never reached it. If you have a number of ORs or ANDs which gets anywhere near the limit I would suggest you need to code you data step differently.&lt;BR /&gt;
&lt;BR /&gt;
I would however suggest, in the example you give, using the IN operator.&lt;BR /&gt;
&lt;BR /&gt;
e.g.&lt;BR /&gt;
&lt;BR /&gt;
if type in ('a' 'b3' 'a21') then output test1;&lt;BR /&gt;
&lt;BR /&gt;
Hope that helps.</description>
      <pubDate>Tue, 17 Mar 2009 15:11:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/request-to-know-how-many-and-or-can-be-used-with-in-a-single-if/m-p/77072#M22338</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-17T15:11:03Z</dc:date>
    </item>
    <item>
      <title>Re: request to know how many and  or can be used with in a single if clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/request-to-know-how-many-and-or-can-be-used-with-in-a-single-if/m-p/77073#M22339</link>
      <description>most probably quite a few ...&lt;BR /&gt;
&lt;BR /&gt;
To reduce typing, consider &lt;BR /&gt;
&lt;BR /&gt;
if type in ('a', 'a21', 'b3') then ...</description>
      <pubDate>Tue, 17 Mar 2009 15:13:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/request-to-know-how-many-and-or-can-be-used-with-in-a-single-if/m-p/77073#M22339</guid>
      <dc:creator>Bill</dc:creator>
      <dc:date>2009-03-17T15:13:16Z</dc:date>
    </item>
    <item>
      <title>Re: request to know how many and  or can be used with in a single if clause</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/request-to-know-how-many-and-or-can-be-used-with-in-a-single-if/m-p/77074#M22340</link>
      <description>Excellent, many thanks for both of you. &lt;BR /&gt;
My mind didn't striked about in operator.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for u r help</description>
      <pubDate>Thu, 19 Mar 2009 08:43:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/request-to-know-how-many-and-or-can-be-used-with-in-a-single-if/m-p/77074#M22340</guid>
      <dc:creator>ssas</dc:creator>
      <dc:date>2009-03-19T08:43:51Z</dc:date>
    </item>
  </channel>
</rss>

