<?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 variable in another variable in SAS Studio</title>
    <link>https://communities.sas.com/t5/SAS-Studio/find-variable-in-another-variable/m-p/442635#M4818</link>
    <description>&lt;P&gt;Assuming that both variables are character, you should be able to make a small change:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if index(site_affected, strip(siteid)) gt 0 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will remove extra blanks that might be part of SITEID, making the longer-version-with-blanks appear is though it as not part of SITE_AFFECTED.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are other possibilities using FINDW, but based on what you posted it looks like this simpler version should be fine.&lt;/P&gt;</description>
    <pubDate>Mon, 05 Mar 2018 21:35:47 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2018-03-05T21:35:47Z</dc:date>
    <item>
      <title>find variable in another variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/find-variable-in-another-variable/m-p/442632#M4817</link>
      <description>&lt;P&gt;I would like to find siteid in the site_affected. If it's in the list then I can do something afterward. However, I was not able to use the find, index function to achieve this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if index(site_affected, siteid) gt 0 then do;&lt;/P&gt;&lt;P&gt;date = 01/JAN/1990;&lt;/P&gt;&lt;P&gt;date2 = 02/JAN/2990;&lt;/P&gt;&lt;P&gt;end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;siteid&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; site_affected&lt;/P&gt;&lt;P&gt;1071&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; 1059; 1061; 1100; 1105; 1190; 1003; 1017; 1022; 1063; 1071; 1144&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;date and dates are empty from the code.&lt;/P&gt;&lt;P&gt;Will appreciate any input!&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 21:15:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/find-variable-in-another-variable/m-p/442632#M4817</guid>
      <dc:creator>leela214</dc:creator>
      <dc:date>2018-03-05T21:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: find variable in another variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/find-variable-in-another-variable/m-p/442635#M4818</link>
      <description>&lt;P&gt;Assuming that both variables are character, you should be able to make a small change:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if index(site_affected, strip(siteid)) gt 0 then do;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That will remove extra blanks that might be part of SITEID, making the longer-version-with-blanks appear is though it as not part of SITE_AFFECTED.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are other possibilities using FINDW, but based on what you posted it looks like this simpler version should be fine.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Mar 2018 21:35:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/find-variable-in-another-variable/m-p/442635#M4818</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2018-03-05T21:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: find variable in another variable</title>
      <link>https://communities.sas.com/t5/SAS-Studio/find-variable-in-another-variable/m-p/442695#M4841</link>
      <description>Thank you so much! It work. I tried using the option, 't' -trim in other function too, but didn't work too. I'm glad you were able to solve my question!</description>
      <pubDate>Tue, 06 Mar 2018 01:31:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Studio/find-variable-in-another-variable/m-p/442695#M4841</guid>
      <dc:creator>leela214</dc:creator>
      <dc:date>2018-03-06T01:31:06Z</dc:date>
    </item>
  </channel>
</rss>

