<?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: Need to find like name in a variable in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171602#M44257</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had to add in "strip"......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANK YOU!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 23 May 2014 19:37:21 GMT</pubDate>
    <dc:creator>HockeyMom2508</dc:creator>
    <dc:date>2014-05-23T19:37:21Z</dc:date>
    <item>
      <title>Need to find like name in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171599#M44254</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So.... I am having an issue trying to find a character string within another variable.&amp;nbsp; The problem is that the string that I am looking to find is in another variable.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; My data looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Generic Name&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FormalName&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;drugABCD&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; drugABCDEFG&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I need to look in "formal name" to find what is in "generic name".&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Here is the code that I used but it is NOT working:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="code.jpg" class="jive-image-thumbnail jive-image" src="https://communities.sas.com/legacyfs/online/6427_code.jpg" width="450" /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2014 19:04:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171599#M44254</guid>
      <dc:creator>HockeyMom2508</dc:creator>
      <dc:date>2014-05-23T19:04:00Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find like name in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171600#M44255</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear HMom;&lt;/P&gt;&lt;P&gt;Please clarify for me your variable names.&amp;nbsp; Your example name and the names in your code confused me.&amp;nbsp; I'm assuming that you want to find out if the value in GenericName is in the variable FormalName.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;1654&amp;nbsp; data have;&lt;BR /&gt;1655&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length GenericName FormalName Gen_Name $20.;&lt;BR /&gt;1656&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GenericName = upcase('drugABCD');&lt;BR /&gt;1657&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FormalName&amp;nbsp; = upcase('drugABCDEFG');&lt;BR /&gt;1658&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Gen_name&amp;nbsp;&amp;nbsp;&amp;nbsp; = scan(FormalName,1,' ');&lt;BR /&gt;1659&amp;nbsp; put _all_;&lt;BR /&gt;1660&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;GenericName=DRUGABCD FormalName=DRUGABCDEFG Gen_Name=DRUGABCDEFG _ERROR_=0 _N_=1&lt;BR /&gt;NOTE: The data set WORK.HAVE has 1 observations and 3 variables.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;1679&lt;BR /&gt;1680&amp;nbsp; data temp1;&lt;BR /&gt;1681&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; set have;&lt;BR /&gt;1682&amp;nbsp;&amp;nbsp;&amp;nbsp; x = index(FormalName,(substr(strip(gen_name),1,(length(GenericName)))));&lt;BR /&gt;1683&amp;nbsp; put x;&lt;BR /&gt;1684&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;1&lt;BR /&gt;NOTE: There were 1 observations read from the data set WORK.HAVE.&lt;BR /&gt;NOTE: The data set WORK.TEMP1 has 1 observations and 4 variables.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2014 19:24:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171600#M44255</guid>
      <dc:creator>jwillis</dc:creator>
      <dc:date>2014-05-23T19:24:49Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find like name in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171601#M44256</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I need to be sure that whatever is contained in the variable gen_name on that particular row is somewhere in prod_serv_nm&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2014 19:34:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171601#M44256</guid>
      <dc:creator>HockeyMom2508</dc:creator>
      <dc:date>2014-05-23T19:34:43Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find like name in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171602#M44257</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I had to add in "strip"......&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;THANK YOU!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2014 19:37:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171602#M44257</guid>
      <dc:creator>HockeyMom2508</dc:creator>
      <dc:date>2014-05-23T19:37:21Z</dc:date>
    </item>
    <item>
      <title>Re: Need to find like name in a variable</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171603#M44258</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;did you try the find() function?&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;found =&amp;nbsp; find( prod_serv_nm, gen_name, 't' ) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;the 't' directs the search to trim before hunting&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 23 May 2014 19:39:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Need-to-find-like-name-in-a-variable/m-p/171603#M44258</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2014-05-23T19:39:32Z</dc:date>
    </item>
  </channel>
</rss>

