<?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: FIND vs FINDW or anything else in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477219#M122868</link>
    <description>&lt;P&gt;Thats ok but it need one variable to be searched in the other one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;key = find(upcase(var1),upcase(var2));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so the issue is that composed words like SUCESSFULLY will be count as 1 when searching for SUCESS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and using FINDW would not work all the time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jul 2018 19:28:14 GMT</pubDate>
    <dc:creator>BernyOsuna</dc:creator>
    <dc:date>2018-07-11T19:28:14Z</dc:date>
    <item>
      <title>FIND vs FINDW or anything else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477207#M122861</link>
      <description>&lt;P&gt;I have this list of words and i need to check if those words exist in another variable, in the same dataset, which cointains a set of words separated by ','.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data dataset;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;set dataset;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;x = find(upcase(var1),upcase(var2));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;this works most of the time, but if i have to look for SUCESS its telling me that the word exist because it reads SUCCESSfully, so need te exact word.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So then i moved to FINDW&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;data dataset;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;set dataset;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;x = find(upcase(var1),upcase(var2));&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;run;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But for 2 words at the same time like: BEST BUY and the string is COCA COLA, BEST BUY it brings 0 meaning it couldnt find it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;It was to work for both: single words or 2 or more words a the same time.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 19:12:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477207#M122861</guid>
      <dc:creator>BernyOsuna</dc:creator>
      <dc:date>2018-07-11T19:12:41Z</dc:date>
    </item>
    <item>
      <title>Re: FIND vs FINDW or anything else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477212#M122864</link>
      <description>&lt;P&gt;data w;&lt;BR /&gt;k='SUCCESSfully';&lt;BR /&gt;if findw(k,'SUCCESS')&amp;gt;0 then put 'found';&lt;BR /&gt;else put'not found';&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 19:22:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477212#M122864</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-11T19:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: FIND vs FINDW or anything else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477219#M122868</link>
      <description>&lt;P&gt;Thats ok but it need one variable to be searched in the other one&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;key = find(upcase(var1),upcase(var2));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so the issue is that composed words like SUCESSFULLY will be count as 1 when searching for SUCESS&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and using FINDW would not work all the time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 19:28:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477219#M122868</guid>
      <dc:creator>BernyOsuna</dc:creator>
      <dc:date>2018-07-11T19:28:14Z</dc:date>
    </item>
    <item>
      <title>Re: FIND vs FINDW or anything else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477220#M122869</link>
      <description>&lt;P&gt;Can you please post a sample of few records ?&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 19:30:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477220#M122869</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-11T19:30:54Z</dc:date>
    </item>
    <item>
      <title>Re: FIND vs FINDW or anything else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477227#M122871</link>
      <description>&lt;P&gt;VAR1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VAR2&lt;/P&gt;&lt;P&gt;COCA COLA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PEPSI, COCA COLA&lt;/P&gt;&lt;P&gt;LANIX&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LANIX, SONY&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;KEY = FIND(VAR1,VAR2);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VAR2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KEY&lt;/P&gt;&lt;P&gt;COCA COLA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PEPSI, COCA COLA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 8&lt;/P&gt;&lt;P&gt;LANIX&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LANIX, SONY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;SUCESS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUCESSFULLY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;KEY = FINDW(VAR1,VAR2);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;VAR1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;VAR2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; KEY&lt;/P&gt;&lt;P&gt;COCA COLA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;PEPSI, COCA COLA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; O&lt;/P&gt;&lt;P&gt;LANIX&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; LANIX, SONY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;1&lt;/P&gt;&lt;P&gt;SUCESS&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SUCESSFULLY&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 0&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 19:36:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477227#M122871</guid>
      <dc:creator>BernyOsuna</dc:creator>
      <dc:date>2018-07-11T19:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: FIND vs FINDW or anything else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477235#M122876</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input VAR1  &amp;amp; $10.                         VAR2 &amp;amp;  $20.;
cards;
COCA COLA               PEPSI, COCA COLA            8
LANIX                          LANIX, SONY                       1
SUCESS                      SUCESSFULLY                    1
PEPSI				PEPSI
;

data want;
set have;
do _n_=1 to countw(var2,',');
k=findw(var1,strip(scan(var2,_n_,',')));
if k&amp;gt;0 then leave;
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jul 2018 20:02:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477235#M122876</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2018-07-11T20:02:28Z</dc:date>
    </item>
    <item>
      <title>Re: FIND vs FINDW or anything else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477238#M122878</link>
      <description>&lt;P&gt;Do you have control over the format of VAR2?&amp;nbsp; The easiest way would be to add commas, and take out spaces around the commas.&amp;nbsp; For example:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VAR2=",COCA COLA,BEST BUY,";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Second easiest would be if you could just eliminate the spaces around the commas:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;VAR2="COCA COLA,BEST BUY";&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In the top version, you could use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;found = index(var2, "," || strip(VAR1) || ",");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might have to adjust the value of FOUND by 1, due to the presence of the extra commas.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For the bottom version, you would end up with a more complex expression:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;found = index("," || strip(var2) || "," , "," || strip(VAR1) || "," ) ;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Again,&amp;nbsp;you might have to adjust the result by 1.&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jul 2018 20:10:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477238#M122878</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-07-11T20:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: FIND vs FINDW or anything else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477558#M123017</link>
      <description>&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;I HOPE YOU FIND THIS MORE UNDERSTANDABLE&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;* CREATE MAIN TABLE *;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DATA TABLE1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;INFORMAT CAT $15. VALUE $500.;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;INFILE DATALINES DLM = '09X';&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;INPUT CAT $ VALUE $;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DATALINES;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;PAYMENT09XSUNOCO PAY, BEST BUY PAY,&amp;nbsp;&lt;SPAN&gt;SUCESSFUL&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;*UNIFY FORMATS*;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DATA TABLE1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;RETAIN SOURCE CAT VALUE;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;SET TABLE1;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; SOURCE ='EMAIL';&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; VALUE=COMPRESS(VALUE,'09X');&amp;nbsp; &amp;nbsp;* ELIMINATE TABS *;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; VALUE=TRANWRD(VALUE," ,",","); * REMOVE SPACE BETWEEN WORD AND COMMA *;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; VALUE=TRANWRD(VALUE,", ",","); * REMOVE SPACE BETWEEN COMMA AND WORD *;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; VALUE=TRANWRD(VALUE,",",", "); * PUT A&amp;nbsp; SPACE BETWEEN COMMA AND WORD *;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; USER=UPCASE("&amp;amp;SYSUSERID.");&amp;nbsp; &amp;nbsp; * RECORD USERNAME *;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; TIMESTAMP = DATETIME();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; FORMAT TIMESTAMP DATETIME16.;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;* TABLE 2 IS IMPORTED BUT FOR TIME REASONS I'LL JUST CREATE IT *;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DATA TABLE2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;INFORMAT WORD $15.;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;INFILE DATALINES DSD;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DATALINES;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;INPUT WORD $;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;SUCESS&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;BEST BUY PAY&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;* PREPARE TABLE 2 *;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;PROC SORT DATA = TABLE2 NODUPKEY OUT=T2; BY WORD; RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DATA T2; RETAIN CAT; SET T2; CAT = "PAYMENT"; RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;* CREATE TABLE 3 THATS WHERE THE ISSUE HAPPENS *;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;DATA TABLE3;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;LENGTH CAT $15 WORD $50. VALUE $500.;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;IF _N_ = 1 THEN DO;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;DECLARE HASH 3 (DATASET:'TABLE1');&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;E.DEFINEKEY('CAT');&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;E.DEFINEDATA('CAT','VALUE');&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;E.DEFINEDONE();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp; &amp;nbsp;CALL MISSING(CAT,VALUE);&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;END;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;SET T2;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;DROP RC;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;RC = E.FIND();&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&amp;nbsp;FINDW = FINDW(VALUE,WORD,'I');&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;&lt;SPAN&gt;&amp;nbsp;FIND&amp;nbsp; = FIND(TRIM(VALUE),TRIM(UPCASE(WORD)));&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT face="courier new,courier"&gt;RUN;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 15:34:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477558#M123017</guid>
      <dc:creator>BernyOsuna</dc:creator>
      <dc:date>2018-07-12T15:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: FIND vs FINDW or anything else</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477599#M123032</link>
      <description>&lt;P&gt;Usually this is caused by including the trailing spaces in the text that you are searching for.&amp;nbsp; SAS stores character strings as fixed length.&amp;nbsp; So you need to remove the trailing spaces before passing the string to the FINDW() function.&amp;nbsp; You can use the modifiers of the FINDW() command to make this easier.&amp;nbsp; I like to use SPIT as the modifiers for this.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data test;
  length str $200 word $50 ;
  infile cards dsd dlm='|' truncover ;
  input str word ;
  found_any=index(upcase(str),upcase(strip(word)));
  found_word=findw(str,word,,'spit');
  put (_all_) (=) ;
cards;
Successfully|success
Coca Cola,Best Buy|BEST BUY
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;PRE&gt;str=Successfully word=success found_any=1 found_word=0
str=Coca Cola,Best Buy word=BEST BUY found_any=11 found_word=11&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Jul 2018 21:31:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FIND-vs-FINDW-or-anything-else/m-p/477599#M123032</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2018-07-12T21:31:04Z</dc:date>
    </item>
  </channel>
</rss>

