<?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: SAS find function in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/603409#M18395</link>
    <description>Thanks a lot.</description>
    <pubDate>Tue, 12 Nov 2019 00:22:51 GMT</pubDate>
    <dc:creator>aaaaa34</dc:creator>
    <dc:date>2019-11-12T00:22:51Z</dc:date>
    <item>
      <title>SAS find function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/603394#M18389</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What does this function?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;find(variable1, "&amp;amp;variable2")&amp;gt;0 or&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I saw it in some code online.&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2019 23:11:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/603394#M18389</guid>
      <dc:creator>aaaaa34</dc:creator>
      <dc:date>2019-11-11T23:11:07Z</dc:date>
    </item>
    <item>
      <title>Re: SAS find function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/603405#M18392</link>
      <description>&lt;P&gt;Hi:&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Let's remove the macro variable out of the code. The &amp;amp;variable2 is just supplying a search value. In the VARIABLE1, the FIND function is searching for whatever is stored in &amp;amp;variable2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; Consider this example I want to FIND names with "Ja" in them and also want to find names with a lowercase "e" in the name. Notice that FIND returns a number which corresponds to the position of the 2nd argument (what I want to look for).:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="what_find_do.png" style="width: 600px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/33850i6A118693369AC8E4/image-size/large?v=v2&amp;amp;px=999" role="button" title="what_find_do.png" alt="what_find_do.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I made 2 separate variables so you could see that when "Ja" did NOT exist, the value for FVAL1 was 0. When "e" does exist, then FVAL2 shows you the position that "e" occupies in the name. There are 19 rows in SASHELP.CLASS, so I only output the 10 rows I was interested in based on using FIND&amp;nbsp; on the NAME variable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Cynthia&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2019 00:14:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/603405#M18392</guid>
      <dc:creator>Cynthia_sas</dc:creator>
      <dc:date>2019-11-12T00:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: SAS find function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/603409#M18395</link>
      <description>Thanks a lot.</description>
      <pubDate>Tue, 12 Nov 2019 00:22:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/603409#M18395</guid>
      <dc:creator>aaaaa34</dc:creator>
      <dc:date>2019-11-12T00:22:51Z</dc:date>
    </item>
    <item>
      <title>Re: SAS find function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/613390#M18579</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the same find function to identify every "AND" within a string but I am not getting the required result. I have used the sashelp.demographics dataset as an example;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;data t;&lt;BR /&gt;set sashelp.demographics;&lt;BR /&gt;new_n=find(isoname,"AND");&lt;BR /&gt;if find(isoname,"AND")&amp;gt;0 then output;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My aim is to find "and" in the string 'isoname' then create a new variable for all observations with the "and" so i can count them and separate them from observation without "and".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, In the ISONAME VARIABLE, i want to be able to count variable like "ANTIGUA &lt;FONT color="#FF0000"&gt;AND&lt;/FONT&gt; BARBUDA" and keep them in a new variable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;ANY HELP!&lt;/P&gt;&lt;P&gt;THANKS!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 11:34:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/613390#M18579</guid>
      <dc:creator>CathyVI</dc:creator>
      <dc:date>2019-12-21T11:34:23Z</dc:date>
    </item>
    <item>
      <title>Re: SAS find function</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/613395#M18580</link>
      <description>&lt;P&gt;I don't have that data set, but the default way SAS operates is that the string "and" is not equal to the string "AND". Could that be the reason you are not getting the expected result?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are many ways to remedy this, one of them is to use the 'i' option of the FIND function, which does the comparison of the text strings ignoring case.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if find(isoname,"AND",'i')&amp;gt;0 then output;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 21 Dec 2019 15:18:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/SAS-find-function/m-p/613395#M18580</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-21T15:18:37Z</dc:date>
    </item>
  </channel>
</rss>

