<?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: Reading &amp;quot;(&amp;quot; in SAS macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Reading-quot-quot-in-SAS-macro/m-p/258156#M49679</link>
    <description>&lt;P&gt;Firstly, if your new to SAS, I would strongly advise to learn Base SAS which is the programming language. &amp;nbsp;Macro is a tool for generation of text, i.e. it is only there to generate Base SAS code, so if you don't understand Base SAS, you will struggle with Macro. &amp;nbsp;Also, there are specific uses for macro language, using them randomly for purposes creates unweildy hard to mange and QC code which obfuscated. &amp;nbsp;Take your given example below, if you knew Base SAS, you would know that there are plenty of effecient procedures already built into Base SAS which will both be more efficient, and be known to anyone who uses SAS. &amp;nbsp;Your code will be inefficient and obfuscated for other users. &amp;nbsp;Knowing when to use macro is more important than how to use it. &amp;nbsp;The function you want to use here is index:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212242.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212242.htm&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 22 Mar 2016 09:01:20 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2016-03-22T09:01:20Z</dc:date>
    <item>
      <title>Reading "(" in SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-quot-quot-in-SAS-macro/m-p/258062#M49636</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm new to SAS. I'm creating a macro where I want to find position of any given character in&amp;nbsp;string using index function.&lt;/P&gt;&lt;P&gt;I'm writing following code but&amp;nbsp;macro&amp;nbsp;stops executing.&lt;/P&gt;&lt;P&gt;%macro check(indata=, char=, var=);&lt;/P&gt;&lt;P&gt;data test;&lt;/P&gt;&lt;P&gt;set &amp;amp;indata;&lt;/P&gt;&lt;P&gt;position=index(&amp;amp;var,"%bquote(&amp;amp;char)");&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%check(&lt;SPAN&gt;indata=try, char=(, var=value);&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;it's throwing errors. Not able to figure out whats going wrong&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 20:08:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-quot-quot-in-SAS-macro/m-p/258062#M49636</guid>
      <dc:creator>Neeta</dc:creator>
      <dc:date>2016-03-21T20:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: Reading "(" in SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-quot-quot-in-SAS-macro/m-p/258094#M49650</link>
      <description>&lt;P&gt;The problem is occuring when invoking the macro, since the unbalanced parentheses throw things off.&amp;nbsp; Try quoting the character when you invoke the macro:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%check (indata=try, char=%str(%(), var=value)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In that case, you shouldn't need %BQUOTE any more.&amp;nbsp; Not all characters require quoting, but parentheses do.&lt;/P&gt;</description>
      <pubDate>Mon, 21 Mar 2016 21:14:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-quot-quot-in-SAS-macro/m-p/258094#M49650</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-03-21T21:14:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading "(" in SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-quot-quot-in-SAS-macro/m-p/258105#M49655</link>
      <description>Thank you so much! It's working now!</description>
      <pubDate>Mon, 21 Mar 2016 22:38:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-quot-quot-in-SAS-macro/m-p/258105#M49655</guid>
      <dc:creator>Neeta</dc:creator>
      <dc:date>2016-03-21T22:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: Reading "(" in SAS macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Reading-quot-quot-in-SAS-macro/m-p/258156#M49679</link>
      <description>&lt;P&gt;Firstly, if your new to SAS, I would strongly advise to learn Base SAS which is the programming language. &amp;nbsp;Macro is a tool for generation of text, i.e. it is only there to generate Base SAS code, so if you don't understand Base SAS, you will struggle with Macro. &amp;nbsp;Also, there are specific uses for macro language, using them randomly for purposes creates unweildy hard to mange and QC code which obfuscated. &amp;nbsp;Take your given example below, if you knew Base SAS, you would know that there are plenty of effecient procedures already built into Base SAS which will both be more efficient, and be known to anyone who uses SAS. &amp;nbsp;Your code will be inefficient and obfuscated for other users. &amp;nbsp;Knowing when to use macro is more important than how to use it. &amp;nbsp;The function you want to use here is index:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212242.htm" target="_blank"&gt;http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000212242.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 22 Mar 2016 09:01:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Reading-quot-quot-in-SAS-macro/m-p/258156#M49679</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2016-03-22T09:01:20Z</dc:date>
    </item>
  </channel>
</rss>

