<?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: Like vs contains using where statement to identify obs - different results in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717730#M221997</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Pay attention that CONTAINS is case sensitive while LIKE is not, as shown in next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input str $;
cards;
S
s
so
USA
;
run;
data check;
 set have(where=(str like 's'));
run;
data check;
 set have(where=(str contains 's'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not with SAS code.&lt;/P&gt;
&lt;P&gt;Perhaps you are used to using some other database? I know that Teradata has a case insensitive mode.&amp;nbsp; But even there I don't think it changes based on what operator you use.&amp;nbsp; Some database systems do have a LIKE and an ILIKE operator, the later being the case insensitive version.&lt;/P&gt;</description>
    <pubDate>Mon, 08 Feb 2021 20:34:24 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2021-02-08T20:34:24Z</dc:date>
    <item>
      <title>Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717715#M221987</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm having a lot of difficulty with this. I'm not a very experienced SAS user and I'm using SAS EG 9.4 (not SQL).&lt;/P&gt;
&lt;P&gt;I'm trying to identify observations with specific ICD-10 (e.g., T690) codes from large datasets. I've been using &lt;STRONG&gt;where statements&lt;/STRONG&gt; with &lt;STRONG&gt;contains&lt;/STRONG&gt; or &lt;STRONG&gt;like&lt;/STRONG&gt; but they identify different numbers of records. Is one more accurate than the other? I can't really compare the new datasets because they are so large, so I'm not sure what's going on. Below are examples of my code:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;(WHERE=(MAIN_PROBLEM CONTAINS 'S' OR MAIN_PROBLEM CONTAINS 'T0%' OR MAIN_PROBLEM CONTAINS 'T11%' OR MAIN_PROBLEM CONTAINS 'T12%' &lt;BR /&gt;OR MAIN_PROBLEM CONTAINS 'T13%' OR MAIN_PROBLEM CONTAINS 'T14%'));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;and&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(WHERE=(MAIN_PROBLEM LIKE 'S' OR MAIN_PROBLEM LIKE 'T0%' OR MAIN_PROBLEM LIKE 'T11%' OR MAIN_PROBLEM LIKE 'T12%' &lt;BR /&gt;OR MAIN_PROBLEM LIKE 'T13%' OR MAIN_PROBLEM LIKE 'T14%'));&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any advice is greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 19:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717715#M221987</guid>
      <dc:creator>Angmar</dc:creator>
      <dc:date>2021-02-08T19:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717724#M221993</link>
      <description>&lt;P&gt;First let's recode your WHERE= dataset options as WHERE statements instead.&amp;nbsp; They are just easier to deal with since you don't need to add those extra parentheses.&amp;nbsp; Plus you can augment your WHERE statement with WHERE ALSO statements.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Version 1 */
WHERE
    MAIN_PROBLEM CONTAINS 'S' 
 OR MAIN_PROBLEM CONTAINS 'T0%'
 OR MAIN_PROBLEM CONTAINS 'T11%'
 OR MAIN_PROBLEM CONTAINS 'T12%'
 OR MAIN_PROBLEM CONTAINS 'T13%'
 OR MAIN_PROBLEM CONTAINS 'T14%'
;

/* Version 2 */ 
WHERE
    MAIN_PROBLEM LIKE 'S'
 OR MAIN_PROBLEM LIKE 'T0%'
 OR MAIN_PROBLEM LIKE 'T11%'
 OR MAIN_PROBLEM LIKE 'T12%'
 OR MAIN_PROBLEM LIKE 'T13%'
 OR MAIN_PROBLEM LIKE 'T14%'
; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;So version 1 is checking whether the variable contains the string anywhere in the variable, plus it is literally testing if the variable contains the percent sign character.&lt;/P&gt;
&lt;P&gt;Version 2 is testing if the variable begins with one of those strings.&lt;/P&gt;
&lt;P&gt;Since you are looking at ICD10 codes I would assume that Version 2 is more likely what you want.&amp;nbsp; But I don't think there is any ICD10 code that is just the letter S.&amp;nbsp; Is that some local convention your dataset is using?&lt;/P&gt;
&lt;P&gt;Here is an easier way to do version 2 in SAS code.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;WHERE
    MAIN_PROBLEM = 'S' OR MAIN_PROBLEM in: ('T0' 'T11' 'T12' 'T13' 'T14')
; &lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 20:18:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717724#M221993</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-08T20:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717726#M221995</link>
      <description>&lt;P&gt;The LIKE operator accepts the % wildcard, but the CONTAINS does not.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where Main_Problem &lt;STRONG&gt;contains&lt;/STRONG&gt; 'T0%' means you are specifically looking for the character string &lt;STRONG&gt;T0%&lt;/STRONG&gt; in the value. This would return &lt;STRONG&gt;T0%&lt;/STRONG&gt;, A&lt;STRONG&gt;T0%&lt;/STRONG&gt;, L&lt;STRONG&gt;T0%&lt;/STRONG&gt;2g, etc.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;where Main_Program &lt;STRONG&gt;like&lt;/STRONG&gt; 'T0%' means you are looking for all values that start with T0 with zero or more characters following. This would return &lt;STRONG&gt;T0&lt;/STRONG&gt;A,&lt;STRONG&gt; T0&lt;/STRONG&gt;32, &lt;STRONG&gt;T0&lt;/STRONG&gt;ALL, etc.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 20:17:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717726#M221995</guid>
      <dc:creator>KathyKiraly</dc:creator>
      <dc:date>2021-02-08T20:17:09Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717729#M221996</link>
      <description>&lt;P&gt;Pay attention that both CONTAINS and LIKE are case sensitive.&lt;/P&gt;
&lt;P&gt;Check difference behavior as shown in next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input str $;
cards;
S
s
so
USA&lt;BR /&gt;usage
;
run;
data check;
 set have(where=(str like 's'));
run;
data check;
 set have(where=(str contains 's'));
run;&lt;/CODE&gt;&amp;nbsp;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 20:37:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717729#M221996</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-08T20:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717730#M221997</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/88384"&gt;@Shmuel&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;Pay attention that CONTAINS is case sensitive while LIKE is not, as shown in next code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  input str $;
cards;
S
s
so
USA
;
run;
data check;
 set have(where=(str like 's'));
run;
data check;
 set have(where=(str contains 's'));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Not with SAS code.&lt;/P&gt;
&lt;P&gt;Perhaps you are used to using some other database? I know that Teradata has a case insensitive mode.&amp;nbsp; But even there I don't think it changes based on what operator you use.&amp;nbsp; Some database systems do have a LIKE and an ILIKE operator, the later being the case insensitive version.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 20:34:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717730#M221997</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-08T20:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717732#M221998</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;I have rechecked my code and results and edited my post.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 20:40:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717732#M221998</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-08T20:40:31Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717734#M221999</link>
      <description>Hi, and thank you for taking the time to answer. However, when I look at my dataset created using contains and the %, the dataset contains records, for example, T11-T119, as though the % is functioning as a wildcard like it should with 'like'. Using 'contains' + % finds more records than just using 'contains' or 'like' + %.&lt;BR /&gt;:S :S</description>
      <pubDate>Mon, 08 Feb 2021 20:44:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717734#M221999</guid>
      <dc:creator>Angmar</dc:creator>
      <dc:date>2021-02-08T20:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717736#M222000</link>
      <description>Hello, I'm receiving similar responses, so:&lt;BR /&gt; When I look at my dataset created using contains and the %, the dataset contains records, for example, T11-T119, as though the % is functioning as a wildcard like it should with 'like'. Using 'contains' + % finds more records than just using 'contains' or 'like' + %.&lt;BR /&gt;:S :S</description>
      <pubDate>Mon, 08 Feb 2021 20:47:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717736#M222000</guid>
      <dc:creator>Angmar</dc:creator>
      <dc:date>2021-02-08T20:47:26Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717740#M222001</link>
      <description>&lt;P&gt;Please share the actual code you ran.&amp;nbsp; Make sure to show what dataset you are reading from.&amp;nbsp; Is it using a libref that is pointing to some foreign database?&amp;nbsp; SAS will frequently push WHERE conditions into the the remote database to handle.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also show the SAS log.&amp;nbsp; I know that with the WHERE statement SAS will echo the way it might have re-written the where condition.&amp;nbsp; For example see this log:&lt;/P&gt;
&lt;PRE&gt;39    proc print data=sashelp.class ;
40     where name =: 'A';
41    run;

NOTE: There were 2 observations read from the data set SASHELP.CLASS.
      WHERE name=:'A';
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.14 seconds
      cpu time            0.06 seconds


42    proc print data=sashelp.class ;
43     where name =: 'A' or 1=1;
44    run;

NOTE: There were 19 observations read from the data set SASHELP.CLASS.
      WHERE 1 /* an obviously TRUE WHERE clause */ ;
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.02 seconds
      cpu time            0.01 seconds

&lt;/PRE&gt;
&lt;P&gt;Show some examples of values that are selected by one and not the other.&amp;nbsp; See if you can re-create the program using just those values.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 21:04:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717740#M222001</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-08T21:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717741#M222002</link>
      <description>&lt;P&gt;Adding the % into the text definitely changes how SAS interprets the CONTAINS operation.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;PRE&gt;66    proc print data=sashelp.class ;
67     where name contains 'A%' ;
68    run;

NOTE: No observations were selected from data set SASHELP.CLASS.
NOTE: There were 0 observations read from the data set SASHELP.CLASS.
      WHERE name contains 'A%';
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.00 seconds
      cpu time            0.00 seconds


69    proc print data=sashelp.class ;
70     where name contains 'A' ;
71    run;

NOTE: There were 2 observations read from the data set SASHELP.CLASS.
      WHERE name contains 'A';
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.03 seconds
      cpu time            0.03 seconds


72    proc print data=sashelp.class ;
73     where upcase(name) contains 'A' ;
74    run;

NOTE: There were 11 observations read from the data set SASHELP.CLASS.
      WHERE UPCASE(name) contains 'A';
NOTE: PROCEDURE PRINT used (Total process time):
      real time           0.01 seconds
      cpu time            0.01 seconds
&lt;/PRE&gt;</description>
      <pubDate>Mon, 08 Feb 2021 21:08:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717741#M222002</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-08T21:08:45Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717897#M222081</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/159"&gt;@Tom&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You're right, there are no ICD-10 codes that are just 'S' - I need to identify all records beginning with 'S' or 'T33', so I thought using 'contains' would find all responses beginning with 'S' and include them. The ICD-10 variable is 4 characters long, so I was trying to avoid typing hundreds of ICD-10 codes (for example, 'S445' 'S446' 'T331' 'T332' 'T333', etc).&lt;/P&gt;
&lt;P&gt;Would the 'in' command be the best way to do so?&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 14:02:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717897#M222081</guid>
      <dc:creator>Angmar</dc:creator>
      <dc:date>2021-02-09T14:02:14Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717902#M222083</link>
      <description>&lt;P&gt;With CONTAINS, the % is part of the search string, not a wildcard:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input code $;
datalines;
T1
T2
T119
S1
;

data want1;
set have;
where code contains 'T%';
run;

proc sql;
create table want2 as
  select *
  from have
  where code contains 'T%'
;
quit;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Log:&lt;/P&gt;
&lt;PRE&gt; 72         
 73         data have;
 74         input code $;
 75         datalines;
 
 NOTE: The data set WORK.HAVE has 4 observations and 1 variables.
 NOTE:  Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
       real time           0.00 seconds
       cpu time            0.00 seconds
       
 
 80         ;
 81         
 82         data want1;
 83         set have;
 84         where code contains 'T%';
 85         run;
 
 NOTE: There were 0 observations read from the data set WORK.HAVE.
       WHERE code contains 'T%';
 NOTE: The data set WORK.WANT1 has 0 observations and 1 variables.
 NOTE:  Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
       real time           0.00 seconds
       cpu time            0.01 seconds
&lt;/PRE&gt;
&lt;P&gt;The &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=sqlproc&amp;amp;docsetTarget=p1xdknbejusyl6n12kqn55iahkkj.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;CONTAINS&lt;/A&gt; operator does not match patterns, like the &lt;A href="https://documentation.sas.com/?cdcId=pgmsascdc&amp;amp;cdcVersion=9.4_3.4&amp;amp;docsetId=sqlproc&amp;amp;docsetTarget=n1ege2983n6h0vn1s1uj1459phr9.htm&amp;amp;locale=en" target="_blank" rel="noopener"&gt;LIKE&lt;/A&gt; operator does.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I do not use the %, the condition finds all entries starting with the letter:&lt;/P&gt;
&lt;PRE&gt; 73         data want3;
 74         set have;
 75         where code contains "T";
 76         run;
 
 NOTE: There were 3 observations read from the data set WORK.HAVE.
       WHERE code contains 'T';
 NOTE: The data set WORK.WANT3 has 3 observations and 1 variables.
 NOTE:  Verwendet wurde: DATA statement - (Gesamtverarbeitungszeit):
       real time           0.00 seconds
       cpu time            0.01 seconds
&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Feb 2021 14:17:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717902#M222083</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2021-02-09T14:17:51Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717905#M222084</link>
      <description>&lt;P&gt;If you are looking how "&lt;SPAN&gt;&amp;nbsp;to identify all records beginning with 'S' or 'T33'&amp;nbsp;&lt;/SPAN&gt;" you can use the SUBSTR() function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;where substr(icd10,1,1) = 'S' or substr(icd10,1,3)='T33';&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 09 Feb 2021 14:16:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717905#M222084</guid>
      <dc:creator>Shmuel</dc:creator>
      <dc:date>2021-02-09T14:16:33Z</dc:date>
    </item>
    <item>
      <title>Re: Like vs contains using where statement to identify obs - different results</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717908#M222086</link>
      <description>&lt;P&gt;Using CONTAINS 'S' will find strings with capital S anywhere.&amp;nbsp; The way you coded LIKE 'S' will only find strings that are just the letter S.&amp;nbsp; It is the same as = 'S'.&amp;nbsp; To find strings that start with the letter S you would use LIKE 'S%'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is probably better to not use the CONTAINS operator.&amp;nbsp; If you have any messy values, such as comments, in the variable you might get some false positives.&amp;nbsp; It is better to test that the codes begin with the required characters.&amp;nbsp; For that you can use with the LIKE operator or the IN operator with the colon modifier.&amp;nbsp; The advantage of using the IN: operator is you do not have to re-type the variable name for each string you want to test for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 14:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Like-vs-contains-using-where-statement-to-identify-obs-different/m-p/717908#M222086</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-02-09T14:21:48Z</dc:date>
    </item>
  </channel>
</rss>

