<?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: Quotation marks, quotes and macro parsing in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118393#M24412</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi and thanks for the reply &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please don't take the question to serious. I know how quoting works (at least as far as this is written in the SAS documentation), but wondered on how this is sometimes processed by SAS :smileysilly: and if this is written somewhere, e.g. the manual of BQUOTE does not say that it handles quotation marks that do not appear in pairs in open code differently than in a macro definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question here is more like is this a behaviour, that is to be expected? And if so, is there a documentation for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 11 Sep 2012 12:30:25 GMT</pubDate>
    <dc:creator>Michael_Weiss</dc:creator>
    <dc:date>2012-09-11T12:30:25Z</dc:date>
    <item>
      <title>Quotation marks, quotes and macro parsing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118391#M24410</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm currently trying to understand how SAS processes code. I noticed some weired things where I can not find an explanation in any of the SAS support documents.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The following code does work when included in a macro, but gives the expected error message outside:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;("this is a);&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;("test);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; abc();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;("this is a);&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;("test);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%abc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;It seams as the SAS code processor treats thefirst double quote as the start of a string and processes all following chars as string chars until the next double quote.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The more interesting effect can be seen in the following statement:&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; - This is a &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;(") test;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;This statement works correct outside of a macro, but it crashes the macro compiler when used in a macro definition like:&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; abc();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; - This is a &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;(") test;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;A workaround that was used in our department was as follows:&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; abc();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; - This is a &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;(") test; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt; font-family: SAS Monospace;"&gt;%*%NRBQUOTE(");&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This leads to an other point, does anybody know if the following behaviour is somewhere documented:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;DATA &lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;_NULL_;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt; font-family: SAS Monospace;"&gt;%*This is " the first comment;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 8pt; font-family: SAS Monospace;"&gt;'Hello World'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt; font-family: SAS Monospace;"&gt;%*This is " the second comment;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 8pt; font-family: SAS Monospace;"&gt;'Nothing more to say'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;In this example the first PUT statement is not processed, because it belongs to the first comment which is not closed by the semicolon because of the single quote. Correctly highlighted the code would look like:&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;DATA&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;_NULL_&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #008000; font-size: 8pt; font-family: SAS Monospace;"&gt;%*This is " the first comment;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #008000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; PUT 'Hello World';&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #008000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; %*This is " the second comment;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 8pt; font-family: SAS Monospace;"&gt;'Nothing more to say'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;RUN&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;I guess this should have been posted on a friday afternoon &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt; So have a nice weekend!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 11:11:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118391#M24410</guid>
      <dc:creator>Michael_Weiss</dc:creator>
      <dc:date>2012-09-11T11:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: Quotation marks, quotes and macro parsing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118392#M24411</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;9&amp;nbsp;&amp;nbsp;&amp;nbsp; %MACRO abc();&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;10&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %PUT - This is a %str(%") test;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;11&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %MEND;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;12&amp;nbsp;&amp;nbsp; %abc;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt; font-family: 'SAS Monospace';"&gt;- This is a " test&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;For complied macro code you need functions that work at compile time.&amp;nbsp; STR or NRSTR&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 11:18:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118392#M24411</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-09-11T11:18:56Z</dc:date>
    </item>
    <item>
      <title>Re: Quotation marks, quotes and macro parsing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118393#M24412</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi and thanks for the reply &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please don't take the question to serious. I know how quoting works (at least as far as this is written in the SAS documentation), but wondered on how this is sometimes processed by SAS :smileysilly: and if this is written somewhere, e.g. the manual of BQUOTE does not say that it handles quotation marks that do not appear in pairs in open code differently than in a macro definition.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The question here is more like is this a behaviour, that is to be expected? And if so, is there a documentation for this?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 12:30:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118393#M24412</guid>
      <dc:creator>Michael_Weiss</dc:creator>
      <dc:date>2012-09-11T12:30:25Z</dc:date>
    </item>
    <item>
      <title>Re: Quotation marks, quotes and macro parsing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118394#M24413</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;Michael.Weiss wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;, e.g. the manual of BQUOTE does not say that it handles quotation marks that do not appear in pairs in open code differently than in a macro definition.&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Perhaps not in the exact words you want to see.&amp;nbsp; BQUOTE and NRBQUOTE work when the macro is executed not when the macro code is compiled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 12:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118394#M24413</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-09-11T12:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Quotation marks, quotes and macro parsing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118395#M24414</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok, lets phrase it different, is it somewhere explained, that for the following code&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; abc();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;("this is a);&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;("test);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;The double quotation marks in the %PUT command prevents the first semicolon from closing the command &lt;img id="smileywink" class="emoticon emoticon-smileywink" src="https://communities.sas.com/i/smilies/16x16_smiley-wink.png" alt="Smiley Wink" title="Smiley Wink" /&gt;.&lt;/P&gt;&lt;P&gt;From my point of view, even when the double quotation mark is quoted at runtime, the semicolon is not inside a string and not quoted by a quoting function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 12:53:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118395#M24414</guid>
      <dc:creator>Michael_Weiss</dc:creator>
      <dc:date>2012-09-11T12:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: Quotation marks, quotes and macro parsing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118396#M24415</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote"&gt;
&lt;P&gt;Michael.Weiss wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Ok, lets phrase it different, is it somewhere explained, that for the following code&lt;/P&gt;
&lt;P class="default"&gt;&lt;SPAN style="font-size: 8pt; color: #0000af; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000; font-family: SAS Monospace;"&gt; abc();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="default"&gt;&lt;SPAN style="font-size: 8pt; color: #000000; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #0000af; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000; font-family: SAS Monospace;"&gt;("this is a);&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000; font-family: SAS Monospace;"&gt;("test);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-size: 8pt; color: #0000af; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="font-size: 8pt; color: #000000; font-family: SAS Monospace;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;The double quotation marks in the %PUT command prevents the first semicolon from closing the command &lt;SPAN __jive_emoticon_name="wink"&gt;&lt;/SPAN&gt;.&lt;/P&gt;
&lt;P&gt;From my point of view, even when the double quotation mark is quoted at runtime, the semicolon is not inside a string and not quoted by a quoting function.&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;I believe relevant line from this page &lt;BR /&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p0frhtfqvguv78n1owh5wfeopdrj.htm"&gt;http://support.sas.com/documentation/cdl/en/mcrolref/62978/HTML/default/viewer.htm#p0frhtfqvguv78n1owh5wfeopdrj.htm&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;is "(It does not mask parentheses or quotation marks that are in the argument at&lt;STRONG&gt; compile time&lt;/STRONG&gt;.)"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You need to use STR or NRSTR so that the unmatched quote is quoted at compile time.&lt;/P&gt;&lt;P&gt;%put %str(%")this is a;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 14:13:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118396#M24415</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-09-11T14:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Quotation marks, quotes and macro parsing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118397#M24416</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Good point, but if this would mean that the quotation marks ar not masked and therefore the semicolon is inside a text string, than I would expect a different log message (e.g. the parentheses within the text).&lt;/P&gt;&lt;P&gt;This can be demonstrated even better for single quotation marks like in:&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; abc();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;('this is a);&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;('test);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt; &lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%abc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;();&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;Here I would expect the second NRBQUOTE macro call as part of the log message.&lt;/P&gt;&lt;P class="default"&gt;Additionally you can easily check if the quotation marks are quoted or not with the following code:&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; abc();&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%LET&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; val = &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;('this is a);&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;('test);&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;proc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;sql&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;select&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; value &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;from&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; dictionary&lt;/SPAN&gt;&lt;SPAN style="color: #008080; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;.&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;macros &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;where&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; name &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;eq&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #800080; font-size: 8pt; font-family: SAS Monospace;"&gt;'VAL'&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;quit&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%abc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;();&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;The result shows that the quotation marks are &lt;EM&gt;correctly&lt;/EM&gt; masked.&lt;/P&gt;&lt;P class="default"&gt;And also it does not explain why the next example works, here the first quotation mark is not quoted, but the second is:&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MACRO&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; abc();&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%PUT&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt; &lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%NRBQUOTE&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;("this is a&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%STR&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;(%") test);&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #0000af; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%MEND&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;&lt;STRONG&gt;%abc&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-size: 8pt; font-family: SAS Monospace;"&gt;();&lt;/SPAN&gt;&lt;/P&gt;&lt;P class="default"&gt;&lt;/P&gt;&lt;P class="default"&gt;And again, I do not need a solution for the quotation, I just wanted to know if this is an documented / expected behaviour.&lt;/P&gt;&lt;P class="default"&gt;The background is, I'm currently working on a correct syntax highlighter for SAS code and therefore I would like to highlight code as it is processed by the SAS code parser.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 18:18:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118397#M24416</guid>
      <dc:creator>Michael_Weiss</dc:creator>
      <dc:date>2012-09-11T18:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Quotation marks, quotes and macro parsing</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118398#M24417</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;
&lt;P&gt;Michael.Weiss wrote:&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P class="default"&gt;The background is, I'm currently working on a correct syntax highlighter for SAS code and therefore I would like to highlight code as it is processed by the SAS code parser.&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If that is the case then I think your highlighter should at least consider your first two examples syntax errors.&amp;nbsp; Proper usage as mentioned is %STR or %NRSTR.&amp;nbsp; To make it easy on yourself flag any use of %BQUOTE or %NRBQUOTE (that appear in a macro) where the argument is not a macro variable reference as a "potential syntax error".&amp;nbsp;&amp;nbsp; Does your syntax highligher know if it is looking at statements defined between %MACRO and %MEND.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 11 Sep 2012 21:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Quotation-marks-quotes-and-macro-parsing/m-p/118398#M24417</guid>
      <dc:creator>data_null__</dc:creator>
      <dc:date>2012-09-11T21:24:03Z</dc:date>
    </item>
  </channel>
</rss>

