<?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: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/879977#M347642</link>
    <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/443307"&gt;@bn820&lt;/a&gt; - Please update your post as answered in that case.&lt;/P&gt;</description>
    <pubDate>Fri, 09 Jun 2023 22:31:49 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2023-06-09T22:31:49Z</dc:date>
    <item>
      <title>FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878865#M347234</link>
      <description>&lt;P&gt;The FINDW function is returning smaller count of observations compared to the dataset. e.g) The code returns a freq of 5 for adherence but the actual count is 8 in the dataset.&amp;nbsp; Below is my code:&lt;/P&gt;&lt;P&gt;IF FINDW (upcase(SocialEmotinalStress),upcase('Unstable Housing'))&amp;gt;0 THEN BS_Housing=1; ELSE BS_Housing=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Adherence')&amp;gt;0 THEN BS_Adherence=1; ELSE BS_Adherence=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Chronic Disease')&amp;gt;0 THEN BS_Chronic=1; ELSE BS_Chronic=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Social Support/Isolation')&amp;gt;0 THEN BS_Social=1; ELSE BS_Social=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Lack of Access/Financial Resources')&amp;gt;0 THEN BS_Access=1; ELSE BS_Access=0;&lt;BR /&gt;IF FINDW (upcase(SocialEmotinalStress),upcase('Medical Condition'))&amp;gt;0 THEN BS_Medical=1; ELSE BS_Medical=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Mental Health Conditions')&amp;gt;0 THEN BS_Mental=1; ELSE BS_Mental=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Other')&amp;gt;0 THEN BS_Other1=1; ELSE BS_Other1=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Trauma')&amp;gt;0 THEN BS_Trauma=1; ELSE BS_Trauma=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Stressor')&amp;gt;0 THEN BS_Stressor=1; ELSE BS_Stressor=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Violence and intimate partner violence (IPV)')&amp;gt;0 THEN BS_IPV=1; ELSE BS_IPV=0;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 22:44:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878865#M347234</guid>
      <dc:creator>bn820</dc:creator>
      <dc:date>2023-06-01T22:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878867#M347236</link>
      <description>&lt;P&gt;Please share a portion of the data you are using, along with the desired output for this portion of the data. Please provide the data as working SAS data step code (&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_self"&gt;examples and instructions&lt;/A&gt;); &lt;STRONG&gt;and do &lt;FONT color="#FF0000"&gt;not&lt;/FONT&gt; provide the data in other forms.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 22:53:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878867#M347236</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-06-01T22:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878868#M347237</link>
      <description>I notice you use upcase in the first one, but not in the second. Have you confirmed the case and spelling matches exactly? Are you aware of the it modifiers for the FINDW() function? &lt;BR /&gt;You may also want to consider an array instead. It will keep the code much cleaner and easier to follow.</description>
      <pubDate>Thu, 01 Jun 2023 23:00:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878868#M347237</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-01T23:00:56Z</dc:date>
    </item>
    <item>
      <title>Re: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878869#M347238</link>
      <description>&lt;P&gt;You are searching for multiple word matches but using the single word function search FINDW. Try FIND or INDEX instead.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Jun 2023 23:01:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878869#M347238</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-06-01T23:01:31Z</dc:date>
    </item>
    <item>
      <title>Re: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878870#M347239</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;array _words(3) _temporary_ $50. ('Unstable Housing', 'Adherence', 'Chronic Disease'); *Fill in rest of terms;

array _BS(3) BS_housing bs_adherence bs_chronic; *fill in rest of variables;

do i=1 to dim(_words);
IF FIND (SocialEmotinalStress, _words(i), 'it')&amp;gt;0 THEN _bs(i)=1; ELSE _bs(i)=0;
end;

&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/v_006/lefunctionsref/p00ab6ey29t2i8n1ihel88tqtga9.htm" target="_self"&gt;FIND documentation&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Modifiers (i/t)&lt;/STRONG&gt;&lt;/P&gt;
&lt;DIV id="n1bif4jvv3k3gan0zpmld2fjlwao" class="xisDoc-argDescriptionPair"&gt;
&lt;H4 class="xisDoc-argument"&gt;i or I&lt;/H4&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;ignores character case during the search. If this modifier is not specified, FIND searches only for character substrings with the same case as the characters in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;substring&lt;/EM&gt;.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV id="p17o3ih2a6hvltn1gm8n4ii5zzma" class="xisDoc-argDescriptionPair"&gt;
&lt;H4 class="xisDoc-argument"&gt;t or T&lt;/H4&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;trims trailing blanks from&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;string&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;EM class="xisDoc-userSuppliedValue"&gt;substring&lt;/EM&gt;.&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;Edited to FIND based on&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;answer.&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;DIV class="xisDoc-argumentDescription"&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/443307"&gt;@bn820&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;The FINDW function is returning smaller count of observations compared to the dataset. e.g) The code returns a freq of 5 for adherence but the actual count is 8 in the dataset.&amp;nbsp; Below is my code:&lt;/P&gt;
&lt;P&gt;IF FINDW (upcase(SocialEmotinalStress),upcase('Unstable Housing'))&amp;gt;0 THEN BS_Housing=1; ELSE BS_Housing=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Adherence')&amp;gt;0 THEN BS_Adherence=1; ELSE BS_Adherence=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Chronic Disease')&amp;gt;0 THEN BS_Chronic=1; ELSE BS_Chronic=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Social Support/Isolation')&amp;gt;0 THEN BS_Social=1; ELSE BS_Social=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Lack of Access/Financial Resources')&amp;gt;0 THEN BS_Access=1; ELSE BS_Access=0;&lt;BR /&gt;IF FINDW (upcase(SocialEmotinalStress),upcase('Medical Condition'))&amp;gt;0 THEN BS_Medical=1; ELSE BS_Medical=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Mental Health Conditions')&amp;gt;0 THEN BS_Mental=1; ELSE BS_Mental=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Other')&amp;gt;0 THEN BS_Other1=1; ELSE BS_Other1=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Trauma')&amp;gt;0 THEN BS_Trauma=1; ELSE BS_Trauma=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Stressor')&amp;gt;0 THEN BS_Stressor=1; ELSE BS_Stressor=0;&lt;BR /&gt;IF FINDW (SocialEmotinalStress,'Violence and intimate partner violence (IPV)')&amp;gt;0 THEN BS_IPV=1; ELSE BS_IPV=0;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class="xisDoc-paraSimpleFirst"&gt;&amp;nbsp;&lt;/P&gt;
&lt;/DIV&gt;
&lt;/DIV&gt;</description>
      <pubDate>Thu, 01 Jun 2023 23:08:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/878870#M347239</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-01T23:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/879897#M347599</link>
      <description>&lt;P&gt;Thanks everyone! These were vryhelpful&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 16:44:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/879897#M347599</guid>
      <dc:creator>bn820</dc:creator>
      <dc:date>2023-06-09T16:44:43Z</dc:date>
    </item>
    <item>
      <title>Re: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/879977#M347642</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/443307"&gt;@bn820&lt;/a&gt; - Please update your post as answered in that case.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 22:31:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/879977#M347642</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-06-09T22:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/880032#M347684</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/13976"&gt;@SASKiwi&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;You are searching for multiple word matches but using the single word function search FINDW. Try FIND or INDEX instead.&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;FINDW works fine for finding multiple word matches.&amp;nbsp; As long as the words are in the same order with the separation between the words in the string being searched as they appear in the strings being looked for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;findw('a b c d e','b c',' ')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Will find 'b c' in 'a b c d e'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;findw('a b c d e','b    c',' ')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Will not match.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 18:01:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/880032#M347684</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-06-10T18:01:33Z</dc:date>
    </item>
    <item>
      <title>Re: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/880254#M347800</link>
      <description>&lt;P&gt;Sorry. I am new to SAS community. I am still learning.&lt;/P&gt;</description>
      <pubDate>Mon, 12 Jun 2023 16:55:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/880254#M347800</guid>
      <dc:creator>bn820</dc:creator>
      <dc:date>2023-06-12T16:55:21Z</dc:date>
    </item>
    <item>
      <title>Re: FINDW FUNCTION ISNT'T CAPTURING ALL THE OBSERVATIONS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/880256#M347801</link>
      <description>You usually mark the solution that is the answer, especially if there are multiple answers,.</description>
      <pubDate>Mon, 12 Jun 2023 17:12:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/FINDW-FUNCTION-ISNT-T-CAPTURING-ALL-THE-OBSERVATIONS/m-p/880256#M347801</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2023-06-12T17:12:12Z</dc:date>
    </item>
  </channel>
</rss>

