<?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: Condense IF FIND in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305353#M65129</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if prxmatch('/[a-j]\./',posting_cat2_new) then ...&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2016 12:59:49 GMT</pubDate>
    <dc:creator>gamotte</dc:creator>
    <dc:date>2016-10-18T12:59:49Z</dc:date>
    <item>
      <title>Condense IF FIND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305345#M65124</link>
      <description>&lt;P&gt;Hi, how do I create an INLIST pn an IF FIND?&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 13:30:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305345#M65124</guid>
      <dc:creator>anonymous_user</dc:creator>
      <dc:date>2016-10-18T13:30:17Z</dc:date>
    </item>
    <item>
      <title>Re: Condense IF FIND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305350#M65126</link>
      <description>&lt;P&gt;What does posting_cat_2 look like. &amp;nbsp;Post your test data in the form of a datastep so that we can see what you see and assess the best way to achieve this. &amp;nbsp;If that variable just contains a, b, or c then:&lt;/P&gt;
&lt;P&gt;select(posting_cat_2);&lt;/P&gt;
&lt;P&gt;&amp;nbsp; when ('a') ...&lt;/P&gt;
&lt;P&gt;...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it contains more, then what happens if more than one appear in the string? &amp;nbsp;Is there a defining pattern which can identify these uniquely?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You may find it simpler to do a quick loop:&lt;/P&gt;
&lt;PRE&gt;do i=1 to lengthn(posting_cat_2);
  if char(posting_cat_2,i) in ('a','b',...) then perf='3) &amp;gt;=...';
end;&lt;/PRE&gt;</description>
      <pubDate>Tue, 18 Oct 2016 12:50:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305350#M65126</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-18T12:50:37Z</dc:date>
    </item>
    <item>
      <title>Re: Condense IF FIND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305352#M65128</link>
      <description />
      <pubDate>Tue, 18 Oct 2016 13:30:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305352#M65128</guid>
      <dc:creator>anonymous_user</dc:creator>
      <dc:date>2016-10-18T13:30:52Z</dc:date>
    </item>
    <item>
      <title>Re: Condense IF FIND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305353#M65129</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if prxmatch('/[a-j]\./',posting_cat2_new) then ...&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 12:59:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305353#M65129</guid>
      <dc:creator>gamotte</dc:creator>
      <dc:date>2016-10-18T12:59:49Z</dc:date>
    </item>
    <item>
      <title>Re: Condense IF FIND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305357#M65133</link>
      <description>&lt;P&gt;If your sample values are all left-hand justified, you can also use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if posting_cat2_new in : ('a.', 'b.', 'c.', 'd.', 'g.', 'h.', 'k.', 'i.', 'j.') then ...&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 13:12:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305357#M65133</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-18T13:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Condense IF FIND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305358#M65134</link>
      <description>&lt;P&gt;Then the simplest way is:&lt;/P&gt;
&lt;P&gt;if char(posting_cat_2,1) in ("a","b"...) then ...;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 13:18:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305358#M65134</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-10-18T13:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Condense IF FIND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305361#M65135</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/45151"&gt;@RW9&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Then the simplest way is:&lt;/P&gt;
&lt;P&gt;if char(posting_cat_2,1) in ("a","b"...) then ...;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if scan(posting_cat,1,'.') in ('a','b',...) then ...;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;just for adding another option &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 13:27:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305361#M65135</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2016-10-18T13:27:22Z</dc:date>
    </item>
    <item>
      <title>Re: Condense IF FIND</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305364#M65137</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/30622"&gt;@gamotte&lt;/a&gt; wrote:&lt;BR /&gt;
&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if prxmatch('/[a-j]\./',posting_cat2_new) then ...&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;I like it. I would just tweak a little to make it more robust,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if prxmatch('/^[a-j]\./',left(posting_cat2_new)) then ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2016 13:37:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Condense-IF-FIND/m-p/305364#M65137</guid>
      <dc:creator>Haikuo</dc:creator>
      <dc:date>2016-10-18T13:37:46Z</dc:date>
    </item>
  </channel>
</rss>

