<?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: WHERE, LIKE, wildcard characters, and macro substitutions in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10101#M675</link>
    <description>Yeh, it's only little but it can save a whole lot of effort.</description>
    <pubDate>Tue, 24 Mar 2009 16:17:03 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2009-03-24T16:17:03Z</dc:date>
    <item>
      <title>WHERE, LIKE, wildcard characters, and macro substitutions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10093#M667</link>
      <description>I have a dataset with the variable "field_number" and I want to retain all records that start with a 'T' or 'B'.  I am using this macro substitution and calling it in a where clause: &lt;BR /&gt;
&lt;BR /&gt;
%let fieldnum = 'T%' or 'B%'; &lt;BR /&gt;
&lt;BR /&gt;
data step1; set data;&lt;BR /&gt;
where Field_number like &amp;amp;fieldnum&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
It works if I only want 'T%' samples but not if I also want 'B%' samples.  Seems simple, but I just can't figure out the correct syntax.</description>
      <pubDate>Tue, 24 Mar 2009 15:39:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10093#M667</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-24T15:39:45Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE, LIKE, wildcard characters, and macro substitutions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10094#M668</link>
      <description>Don't you need another like operator?&lt;BR /&gt;
&lt;BR /&gt;
%let fieldnum = like 'T%' or like 'B%';</description>
      <pubDate>Tue, 24 Mar 2009 15:42:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10094#M668</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-03-24T15:42:31Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE, LIKE, wildcard characters, and macro substitutions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10095#M669</link>
      <description>Don't you need another like operator?&lt;BR /&gt;
&lt;BR /&gt;
%let fieldnum = like 'T%' or like 'B%';</description>
      <pubDate>Tue, 24 Mar 2009 15:42:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10095#M669</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2009-03-24T15:42:44Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE, LIKE, wildcard characters, and macro substitutions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10096#M670</link>
      <description>I suppose that would work but it's not the clean solution I was looking for.

Tried it and received errors.  Probably have incorrect parenthesis in the where clause.&lt;BR /&gt;
&lt;BR /&gt;
    &lt;BR /&gt;
Message was edited by: DDC</description>
      <pubDate>Tue, 24 Mar 2009 15:45:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10096#M670</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-24T15:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE, LIKE, wildcard characters, and macro substitutions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10097#M671</link>
      <description>Why not just:&lt;BR /&gt;
&lt;BR /&gt;
where field_number in: ('T' 'B');</description>
      <pubDate>Tue, 24 Mar 2009 15:57:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10097#M671</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-24T15:57:08Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE, LIKE, wildcard characters, and macro substitutions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10098#M672</link>
      <description>Because the field_number is more than one character, and I want those that start with T or B (which is why I have the %).  And I can't get IN to work with character wildcard.</description>
      <pubDate>Tue, 24 Mar 2009 16:05:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10098#M672</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-24T16:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE, LIKE, wildcard characters, and macro substitutions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10099#M673</link>
      <description>The colon after the IN tells SAS to look for cases where the value starts with the characters/s in the quotes.</description>
      <pubDate>Tue, 24 Mar 2009 16:07:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10099#M673</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-24T16:07:38Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE, LIKE, wildcard characters, and macro substitutions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10100#M674</link>
      <description>Ahhh, I overlooked the colon in your post.  Works now.  Good to know.  Thanks a lot.</description>
      <pubDate>Tue, 24 Mar 2009 16:11:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10100#M674</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-24T16:11:21Z</dc:date>
    </item>
    <item>
      <title>Re: WHERE, LIKE, wildcard characters, and macro substitutions</title>
      <link>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10101#M675</link>
      <description>Yeh, it's only little but it can save a whole lot of effort.</description>
      <pubDate>Tue, 24 Mar 2009 16:17:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/WHERE-LIKE-wildcard-characters-and-macro-substitutions/m-p/10101#M675</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2009-03-24T16:17:03Z</dc:date>
    </item>
  </channel>
</rss>

