<?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: Why the macro in not giving any output? in SAS Data Science</title>
    <link>https://communities.sas.com/t5/SAS-Data-Science/Why-the-macro-in-not-giving-any-output/m-p/133306#M1198</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also confusing the rules for strings between macro and datastep code.&lt;/P&gt;&lt;P&gt;Try using this line:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%if %index(devara, deva) %then %put exists&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro literals do not need quotes to delimit but data step string literals do. Since macro variables would be reference by &amp;amp;var then without the &amp;amp; the macro processor treats what follows as string literal.&lt;/P&gt;&lt;P&gt;And you original code failed because "deva" did not occur within the source string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 06 Nov 2013 15:50:48 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2013-11-06T15:50:48Z</dc:date>
    <item>
      <title>Why the macro in not giving any output?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Why-the-macro-in-not-giving-any-output/m-p/133304#M1196</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can any one help me here?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro one;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if %index("devara", "deva")&amp;nbsp; %then %put exists;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%one;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 08:13:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Why-the-macro-in-not-giving-any-output/m-p/133304#M1196</guid>
      <dc:creator>devarayalu</dc:creator>
      <dc:date>2013-11-06T08:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why the macro in not giving any output?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Why-the-macro-in-not-giving-any-output/m-p/133305#M1197</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;the above macro is working, however since the index function is unable to find the text "deva" including the quotes in "devara" it is not displaying anything in the log. Please try the below code and check the log you will find not exists in the log.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro one;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if %index("devara", "deva")&amp;nbsp; %then %put exists;&lt;/P&gt;&lt;P&gt;%else %put not exists;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %one;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 08:33:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Why-the-macro-in-not-giving-any-output/m-p/133305#M1197</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2013-11-06T08:33:46Z</dc:date>
    </item>
    <item>
      <title>Re: Why the macro in not giving any output?</title>
      <link>https://communities.sas.com/t5/SAS-Data-Science/Why-the-macro-in-not-giving-any-output/m-p/133306#M1198</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Also confusing the rules for strings between macro and datastep code.&lt;/P&gt;&lt;P&gt;Try using this line:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%if %index(devara, deva) %then %put exists&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro literals do not need quotes to delimit but data step string literals do. Since macro variables would be reference by &amp;amp;var then without the &amp;amp; the macro processor treats what follows as string literal.&lt;/P&gt;&lt;P&gt;And you original code failed because "deva" did not occur within the source string.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 06 Nov 2013 15:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Science/Why-the-macro-in-not-giving-any-output/m-p/133306#M1198</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2013-11-06T15:50:48Z</dc:date>
    </item>
  </channel>
</rss>

