<?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: Passing text with &amp;quot;D and &amp; in macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Passing-text-with-quot-D-and-in-macro/m-p/121767#M24940</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe %SUPERQ will mask the &amp;amp; and " allowing you to pass the string through without attempting to resolve the &amp;amp; reference. To use %Superquote the path will be stored in a macro variable then referenced.&lt;/P&gt;&lt;P&gt;&lt;A name="p0ko6o3dusqk23n1b4k3g9xs42up"&gt;&lt;/A&gt;&lt;/P&gt;&lt;PRE class="code"&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;call symput('mv1','Smith&amp;amp;Jones');&lt;/P&gt;
&lt;P&gt;call symput('mv2','%macro abc;');&lt;/P&gt;
&lt;P&gt;run; %let testmv1=%superq(mv1);&lt;/P&gt;
&lt;P&gt;%let testmv2=%superq(mv2);&lt;/P&gt;
&lt;P&gt;%put Macro variable TESTMV1 is &amp;amp;testmv1;&lt;/P&gt;
&lt;P&gt;%put Macro variable TESTMV2 is &amp;amp;testmv2;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;A name="n1pudphrk2c8ggn1emtkbdmtm0xj"&gt;&lt;/A&gt;When this program executes, these lines are written to the SAS log: &lt;/P&gt;&lt;PRE class="outputFragment"&gt;
&lt;P&gt;Macro variable TESTMV1 is Smith&amp;amp;Jones &lt;/P&gt;
&lt;P&gt;Macro variable TESTMV2 is %macro abc;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 21 May 2012 11:15:14 GMT</pubDate>
    <dc:creator>DanRalyea</dc:creator>
    <dc:date>2012-05-21T11:15:14Z</dc:date>
    <item>
      <title>Passing text with "D and &amp; in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-text-with-quot-D-and-in-macro/m-p/121766#M24939</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hello all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; I have made one link format and applied it to one variable. Now i want to pass this variable in macro.&lt;/P&gt;&lt;P&gt;The value of variable is as follows:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&lt;SPAN lang="EN"&gt;The value of Path_name is : &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 14pt;"&gt;&lt;SPAN style=": ; color: #3366ff;"&gt;&amp;lt;a href='javascript:goToObject&lt;SPAN style="color: #ff0000;"&gt;("&lt;/SPAN&gt;Director?_directive=GRC_FinancialImpact&lt;SPAN style="color: #ff0000;"&gt;&amp;amp;handle&lt;/SPAN&gt;=10314|")'&amp;gt; 10314&amp;lt;/a&amp;gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;SPAN style=": ; color: #3366ff;"&gt;I want to pass it in macro variable. I tried %str and %nrstr but still it is giving error. Any solution??&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;/SPAN&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;SPAN&gt;&lt;SPAN lang="EN"&gt;Regards,&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #575757;"&gt;&lt;SPAN&gt;&lt;SPAN lang="EN"&gt;Rakshit&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 10:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-text-with-quot-D-and-in-macro/m-p/121766#M24939</guid>
      <dc:creator>rakshit_shah</dc:creator>
      <dc:date>2012-05-21T10:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Passing text with "D and &amp; in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-text-with-quot-D-and-in-macro/m-p/121767#M24940</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I believe %SUPERQ will mask the &amp;amp; and " allowing you to pass the string through without attempting to resolve the &amp;amp; reference. To use %Superquote the path will be stored in a macro variable then referenced.&lt;/P&gt;&lt;P&gt;&lt;A name="p0ko6o3dusqk23n1b4k3g9xs42up"&gt;&lt;/A&gt;&lt;/P&gt;&lt;PRE class="code"&gt;
&lt;P&gt;data _null_;&lt;/P&gt;
&lt;P&gt;call symput('mv1','Smith&amp;amp;Jones');&lt;/P&gt;
&lt;P&gt;call symput('mv2','%macro abc;');&lt;/P&gt;
&lt;P&gt;run; %let testmv1=%superq(mv1);&lt;/P&gt;
&lt;P&gt;%let testmv2=%superq(mv2);&lt;/P&gt;
&lt;P&gt;%put Macro variable TESTMV1 is &amp;amp;testmv1;&lt;/P&gt;
&lt;P&gt;%put Macro variable TESTMV2 is &amp;amp;testmv2;&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&lt;A name="n1pudphrk2c8ggn1emtkbdmtm0xj"&gt;&lt;/A&gt;When this program executes, these lines are written to the SAS log: &lt;/P&gt;&lt;PRE class="outputFragment"&gt;
&lt;P&gt;Macro variable TESTMV1 is Smith&amp;amp;Jones &lt;/P&gt;
&lt;P&gt;Macro variable TESTMV2 is %macro abc;&lt;/P&gt;
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 21 May 2012 11:15:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-text-with-quot-D-and-in-macro/m-p/121767#M24940</guid>
      <dc:creator>DanRalyea</dc:creator>
      <dc:date>2012-05-21T11:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: Passing text with "D and &amp; in macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Passing-text-with-quot-D-and-in-macro/m-p/121768#M24941</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;In your path_name, there are several unmatched single or double quote , you should put % before it to avoid error message.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let path=%nrstr(&amp;lt;a href=%'javascript:goToObject(%"Director?_directive=GRC_FinancialImpact&amp;amp;handle=10314|%")%'&amp;gt; 10314&amp;lt;/a&amp;gt;) ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;path;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 22 May 2012 02:46:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Passing-text-with-quot-D-and-in-macro/m-p/121768#M24941</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-05-22T02:46:20Z</dc:date>
    </item>
  </channel>
</rss>

