<?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 is not working properly with %let statement in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154879#M30366</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom, thanks for your answer. It worked out great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 11 Aug 2014 14:11:50 GMT</pubDate>
    <dc:creator>jay_q</dc:creator>
    <dc:date>2014-08-11T14:11:50Z</dc:date>
    <item>
      <title>Index function is not working properly with %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154875#M30362</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Please considering following two statements. 2nd data step returns correct index function result but 1st one failed. Any sugguestion to make index function work with %let statement? Many thanks.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let num=%sysfunc(index('/abc/cde/dev/data/ods','/data'));&lt;BR /&gt;%put &amp;amp;num;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;BR /&gt;num=index('/abc/cde/dev/data/ods','/data');&lt;BR /&gt;put num=;&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;L&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 21:30:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154875#M30362</guid>
      <dc:creator>jay_q</dc:creator>
      <dc:date>2014-08-08T21:30:22Z</dc:date>
    </item>
    <item>
      <title>Re: Index function is not working properly with %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154876#M30363</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;%let num=&lt;/SPAN&gt;&lt;SPAN style="color: #ff0080; font-size: 10pt; font-family: SAS Monospace;"&gt;%index&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;(/abc/cde/dev/data/ods,/data);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;%put &amp;amp;num;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;The macro processor generally doesn't use the quotes to deal with strings.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: SAS Monospace;"&gt;Also there are several MACRO language specific string functions you should use instead of working around the differences when using %sysfunc such as %index, %scan, %substr, %trim and variations such as %Kscan %qkscan,%ksubstr, %ktrim&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 08 Aug 2014 21:43:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154876#M30363</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2014-08-08T21:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Index function is not working properly with %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154877#M30364</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The quotes are considered part of the strings by the macro processor. So there is no match because of the quotes around /data.&lt;/P&gt;&lt;P&gt;See what happens if you try it this way.&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;%let num=%sysfunc(index(/abc/cde/dev'/data'/ods','/data'));&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 09 Aug 2014 05:05:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154877#M30364</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-08-09T05:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Index function is not working properly with %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154878#M30365</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: SAS Monospace; font-size: 10pt;"&gt;Thanks for all your reply. It looks like quotes are not necessary in this case. Both statements work the same below. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: SAS Monospace; font-size: 10pt;"&gt;%let num=&lt;/SPAN&gt;&lt;SPAN style="font-family: SAS Monospace; color: #ff0080; font-size: 10pt;"&gt;%index&lt;/SPAN&gt;&lt;SPAN style="font-family: SAS Monospace; font-size: 10pt;"&gt;(/abc/cde/dev/data/ods,/data);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: SAS Monospace; font-size: 10pt;"&gt;%put &amp;amp;num;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: SAS Monospace; font-size: 10pt;"&gt;%let num=%index(/abc/cde/dev/data/ods,/data);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: SAS Monospace; font-size: 10pt;"&gt;%put &amp;amp;num;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2014 14:09:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154878#M30365</guid>
      <dc:creator>jay_q</dc:creator>
      <dc:date>2014-08-11T14:09:52Z</dc:date>
    </item>
    <item>
      <title>Re: Index function is not working properly with %let statement</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154879#M30366</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Tom, thanks for your answer. It worked out great.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 11 Aug 2014 14:11:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Index-function-is-not-working-properly-with-let-statement/m-p/154879#M30366</guid>
      <dc:creator>jay_q</dc:creator>
      <dc:date>2014-08-11T14:11:50Z</dc:date>
    </item>
  </channel>
</rss>

