<?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: Index function strange behaviour in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Index-function-strange-behaviour/m-p/153057#M30093</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;take the quotes out of the %put statement and try again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Peter Crawford&amp;nbsp; &#xD;
Should clarify the statement to change&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Nov 2013 11:08:32 GMT</pubDate>
    <dc:creator>Peter_C</dc:creator>
    <dc:date>2013-11-22T11:08:32Z</dc:date>
    <item>
      <title>Index function strange behaviour</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-strange-behaviour/m-p/153056#M30092</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;running the following code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro boh;&lt;/P&gt;&lt;P&gt; data _null_;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a="aaaaBIANNUAL";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; b="BIANNUAL";&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; q=index(a,b);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; w=index(a,trim(b));&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; put q= w=;&lt;BR /&gt; run;&lt;/P&gt;&lt;P&gt; %put %index("aaaaBIANNUAL", %trim("BIANNUAL")) ;&lt;/P&gt;&lt;P&gt;%mend;&lt;BR /&gt;%boh;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get this result:&lt;/P&gt;&lt;P&gt;q=5 w=5&lt;/P&gt;&lt;P&gt;0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;it semmes that the function index work in two different way if used in a data step or in a macro (in the datastep in a correct wat, in the macro does not work)&lt;/P&gt;&lt;P&gt;Does someone know the reason?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;Bye&lt;/P&gt;&lt;P&gt;Antonio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 10:59:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-strange-behaviour/m-p/153056#M30092</guid>
      <dc:creator>garag</dc:creator>
      <dc:date>2013-11-22T10:59:48Z</dc:date>
    </item>
    <item>
      <title>Re: Index function strange behaviour</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-strange-behaviour/m-p/153057#M30093</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;take the quotes out of the %put statement and try again.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Peter Crawford&amp;nbsp; &#xD;
Should clarify the statement to change&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 11:08:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-strange-behaviour/m-p/153057#M30093</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2013-11-22T11:08:32Z</dc:date>
    </item>
    <item>
      <title>Re: Index function strange behaviour</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-strange-behaviour/m-p/153058#M30094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Macro functions generally are text manipulators and do NOT require the quotes to distinguish between variable names and string literals as in a datastep. If you put a quote in any of the argument strings it is treated as being a part of the string. So "BIANNUAL" is not part of aaaaBIANNUAL in any way.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Nov 2013 19:05:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-strange-behaviour/m-p/153058#M30094</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-11-22T19:05:07Z</dc:date>
    </item>
  </channel>
</rss>

