<?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 locating a string in a string in an SP in Developers</title>
    <link>https://communities.sas.com/t5/Developers/locating-a-string-in-a-string-in-an-SP/m-p/231640#M4777</link>
    <description>&lt;P&gt;I tried this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro getserver;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %LET x=index(&amp;amp;_srvname, "uview");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;%IF x &amp;gt; 0 %THEN %LET server=https://&amp;amp;_srvname&amp;amp;_url; %ELSE %LET server=http://&amp;amp;_srvname:&amp;amp;_srvport&amp;amp;_url;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x seems to evaluate to "index(sas2.domain.com,"uview");" how would I get it to evaluate to a numeric value&lt;/P&gt;</description>
    <pubDate>Mon, 26 Oct 2015 14:59:21 GMT</pubDate>
    <dc:creator>robm</dc:creator>
    <dc:date>2015-10-26T14:59:21Z</dc:date>
    <item>
      <title>locating a string in a string in an SP</title>
      <link>https://communities.sas.com/t5/Developers/locating-a-string-in-a-string-in-an-SP/m-p/231640#M4777</link>
      <description>&lt;P&gt;I tried this&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%macro getserver;&lt;/P&gt;
&lt;P&gt;&amp;nbsp; %LET x=index(&amp;amp;_srvname, "uview");&lt;/P&gt;
&lt;P&gt;&amp;nbsp;%IF x &amp;gt; 0 %THEN %LET server=https://&amp;amp;_srvname&amp;amp;_url; %ELSE %LET server=http://&amp;amp;_srvname:&amp;amp;_srvport&amp;amp;_url;&lt;/P&gt;
&lt;P&gt;%mend;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;x seems to evaluate to "index(sas2.domain.com,"uview");" how would I get it to evaluate to a numeric value&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 14:59:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/locating-a-string-in-a-string-in-an-SP/m-p/231640#M4777</guid>
      <dc:creator>robm</dc:creator>
      <dc:date>2015-10-26T14:59:21Z</dc:date>
    </item>
    <item>
      <title>Re: locating a string in a string in an SP</title>
      <link>https://communities.sas.com/t5/Developers/locating-a-string-in-a-string-in-an-SP/m-p/231644#M4778</link>
      <description>&lt;P&gt;Since you are using the macro language you also have to use macro functions like &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67912/HTML/default/viewer.htm#p1oqafzmrka91un13k8xwap0xv47.htm" target="_self"&gt;%INDEX&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please note, that in the macro language you do not need the quotes around text. So your example would look like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%LET x = %index(&amp;amp;_srvname, uview);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 15:16:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/locating-a-string-in-a-string-in-an-SP/m-p/231644#M4778</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2015-10-26T15:16:22Z</dc:date>
    </item>
    <item>
      <title>Re: locating a string in a string in an SP</title>
      <link>https://communities.sas.com/t5/Developers/locating-a-string-in-a-string-in-an-SP/m-p/231650#M4779</link>
      <description>&lt;P&gt;Building upon what Bruno has mentioned ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Once you follow his advice, you would need to change the way you refer to the macro variable X by adding an ampersand:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if &amp;amp;X &amp;gt; 0 %then ...&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, just get rid of X entirely:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%if %index(&amp;amp;_srvname, uview) &amp;gt; 0 %then ...&lt;/P&gt;</description>
      <pubDate>Mon, 26 Oct 2015 15:42:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/Developers/locating-a-string-in-a-string-in-an-SP/m-p/231650#M4779</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2015-10-26T15:42:12Z</dc:date>
    </item>
  </channel>
</rss>

