<?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: macro code unmatched quote in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856379#M338378</link>
    <description>&lt;P&gt;You could try the "magic string" several times testing if it works after each try.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;;*';*";*/;quit;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 30 Jan 2023 23:46:25 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2023-01-30T23:46:25Z</dc:date>
    <item>
      <title>macro code unmatched quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856371#M338373</link>
      <description>&lt;P&gt;I wrote macro function:&lt;/P&gt;&lt;P&gt;%macro libr;&lt;/P&gt;&lt;P&gt;%put %str(parameter's value);&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;And its destroyed my log: I changed %str to %bquote, but now no one of macro functions doesn't work.&lt;/P&gt;&lt;P&gt;Next I runed this code:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimurShangareev_0-1675119602891.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79941iED340C485E3B8094/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TimurShangareev_0-1675119602891.png" alt="TimurShangareev_0-1675119602891.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;So that code runs:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimurShangareev_1-1675119660491.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79942iA06CAA4BEA1ACF93/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TimurShangareev_1-1675119660491.png" alt="TimurShangareev_1-1675119660491.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;But i still can't use any macro directive:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TimurShangareev_2-1675119744678.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/79943i8475E085138B2E71/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TimurShangareev_2-1675119744678.png" alt="TimurShangareev_2-1675119744678.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;How I can fix that without closing SAS IDE?&lt;/P&gt;&lt;P&gt;(if i close it, i won't be able to start SAS for other reasons (not for this topic) ).&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jan 2023 23:05:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856371#M338373</guid>
      <dc:creator>TimurShangareev</dc:creator>
      <dc:date>2023-01-30T23:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: macro code unmatched quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856379#M338378</link>
      <description>&lt;P&gt;You could try the "magic string" several times testing if it works after each try.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;;*';*";*/;quit;run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 30 Jan 2023 23:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856379#M338378</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2023-01-30T23:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: macro code unmatched quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856402#M338380</link>
      <description>&lt;P&gt;I played with it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you need a single quote, and closing parenthesis, and a %mend.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would submit:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;*' ; *) ; %mend ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;A few times.&amp;nbsp; If you get the error message:&lt;/P&gt;
&lt;PRE&gt;ERROR: No matching %MACRO statement for this %MEND statement.
&lt;/PRE&gt;
&lt;P&gt;That indicates you are likely unstuck.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 02:07:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856402#M338380</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-01-31T02:07:58Z</dc:date>
    </item>
    <item>
      <title>Re: macro code unmatched quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856445#M338402</link>
      <description>&lt;P&gt;I normally use %nrbquote() ...but for your case %bquote() should also do the job.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data _null_;
  call symputx('param',"parameter's value");
run;

%macro libr();
  %put XXX %nrbquote(&amp;amp;param);
%mend;
%libr();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To really provide you with a solution you would need to show us exactly how the macro variable gets populated and how you intend to use the macro.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it's not a function style macro then you could also always use a data _null_ step, use symget() to get the macro value and then a normal SAS data step put/putlog to print the value to the log.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 12:34:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856445#M338402</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2023-01-31T12:34:14Z</dc:date>
    </item>
    <item>
      <title>Re: macro code unmatched quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856446#M338403</link>
      <description>&lt;P&gt;To avoid this issue in the future, please see the example &lt;A href="https://documentation.sas.com/doc/en/pgmmvacdc/9.4/mcrolref/n09tblrxldh8k0n1kt6dkj3xlxug.htm" target="_self"&gt;here&lt;/A&gt; of having a single unmatched quote in a text string.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Jan 2023 12:34:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/macro-code-unmatched-quote/m-p/856446#M338403</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-01-31T12:34:20Z</dc:date>
    </item>
  </channel>
</rss>

