<?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 If and Contains or sounds like in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70787#M20384</link>
    <description>Hello,&lt;BR /&gt;
This might be a simple question, I just want to write something like a where statement but with "if".&lt;BR /&gt;
&lt;BR /&gt;
Made up example:&lt;BR /&gt;
&lt;BR /&gt;
If variable_a like ('yes%maria') then tag='this is maria';&lt;BR /&gt;
else if variable_a like ('yes%jose) then tag='this is jose';&lt;BR /&gt;
else if .......................;&lt;BR /&gt;
&lt;BR /&gt;
etc etc....&lt;BR /&gt;
&lt;BR /&gt;
How is that possible?... what would work with an "if" statement?</description>
    <pubDate>Fri, 11 Sep 2009 14:54:06 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-09-11T14:54:06Z</dc:date>
    <item>
      <title>If and Contains or sounds like</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70787#M20384</link>
      <description>Hello,&lt;BR /&gt;
This might be a simple question, I just want to write something like a where statement but with "if".&lt;BR /&gt;
&lt;BR /&gt;
Made up example:&lt;BR /&gt;
&lt;BR /&gt;
If variable_a like ('yes%maria') then tag='this is maria';&lt;BR /&gt;
else if variable_a like ('yes%jose) then tag='this is jose';&lt;BR /&gt;
else if .......................;&lt;BR /&gt;
&lt;BR /&gt;
etc etc....&lt;BR /&gt;
&lt;BR /&gt;
How is that possible?... what would work with an "if" statement?</description>
      <pubDate>Fri, 11 Sep 2009 14:54:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70787#M20384</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-11T14:54:06Z</dc:date>
    </item>
    <item>
      <title>Re: If and Contains or sounds like</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70788#M20385</link>
      <description>The construct you are suggesting (using LIKE, nor CONTAINS) is not supported with the IF statement of a DATA step.  I am unfamiliar with the SAS-supported Perl regular expressions - others may have some input there?&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 11 Sep 2009 15:53:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70788#M20385</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-11T15:53:06Z</dc:date>
    </item>
    <item>
      <title>Re: If and Contains or sounds like</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70789#M20386</link>
      <description>Yeah, I was wondering if there was something similar to Like or contains but couldn't find it for an IF statement.&lt;BR /&gt;
Could I possibly trick it using a macro variable? constructing a macro variable that uses a "LIKE"? &lt;BR /&gt;
..</description>
      <pubDate>Fri, 11 Sep 2009 20:15:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70789#M20386</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-11T20:15:08Z</dc:date>
    </item>
    <item>
      <title>Re: If and Contains or sounds like</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70790#M20387</link>
      <description>The use of a SAS macro variable has no effect other than being resolved at SAS compilation time.  The use of LIKE is used with PROC SQL only, at least for now.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.</description>
      <pubDate>Fri, 11 Sep 2009 20:34:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70790#M20387</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-11T20:34:42Z</dc:date>
    </item>
    <item>
      <title>Re: If and Contains or sounds like</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70791#M20388</link>
      <description>Correction:  SAS currently supports the WHERE clause (PROC SQL) and WHERE statement (PROC and DATA step), which in turn supports use of the LIKE and CONTAINS operators.&lt;BR /&gt;
&lt;BR /&gt;
It's up to SAS users to voice their support for these types of features, through the SASWare Ballot system.&lt;BR /&gt;
&lt;BR /&gt;
With reading the SGF paper (link below), apparently a Perl-like regular expression may be your answer.  Digest at your own speed though!  I tend to step away from the keyboard/cursor when it comes to Perl expressions.&lt;BR /&gt;
&lt;BR /&gt;
Scott Barry&lt;BR /&gt;
SBBWorks, Inc.&lt;BR /&gt;
&lt;BR /&gt;
Workarounds for SASWare Ballot® Items&lt;BR /&gt;
Jack Hamilton, First Health, West Sacramento, California USA&lt;BR /&gt;
&lt;A href="http://www2.sas.com/proceedings/sugi25/25/po/25p223.pdf" target="_blank"&gt;http://www2.sas.com/proceedings/sugi25/25/po/25p223.pdf&lt;/A&gt;</description>
      <pubDate>Fri, 11 Sep 2009 20:52:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70791#M20388</guid>
      <dc:creator>sbb</dc:creator>
      <dc:date>2009-09-11T20:52:44Z</dc:date>
    </item>
    <item>
      <title>Re: If and Contains or sounds like</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70792#M20389</link>
      <description>If you can't use where clause, you could try, as suggested by sbb, an array of keys with PRXPARSE and then lookup with PRXMATCH.</description>
      <pubDate>Fri, 11 Sep 2009 20:54:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70792#M20389</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-11T20:54:48Z</dc:date>
    </item>
    <item>
      <title>Re: If and Contains or sounds like</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70793#M20390</link>
      <description>thank you all, I'll try these suggestions.</description>
      <pubDate>Mon, 14 Sep 2009 17:43:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/If-and-Contains-or-sounds-like/m-p/70793#M20390</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-09-14T17:43:10Z</dc:date>
    </item>
  </channel>
</rss>

