<?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 concatenate a macro variable with single quote in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/535769#M147155</link>
    <description>&lt;P&gt;I have a macro variable which I first need to convert it to a number and do some mathematical calculation, then I have to cover it with a single quote and bracket.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let num1= 1000;&lt;BR /&gt;%let num2= 1000 - 100;&lt;BR /&gt;%let output = ('&amp;amp;num1.','&amp;amp;num2.');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need output like this:&lt;/P&gt;&lt;P&gt;('1000','900')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Feb 2019 23:06:14 GMT</pubDate>
    <dc:creator>bhu</dc:creator>
    <dc:date>2019-02-14T23:06:14Z</dc:date>
    <item>
      <title>concatenate a macro variable with single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/535769#M147155</link>
      <description>&lt;P&gt;I have a macro variable which I first need to convert it to a number and do some mathematical calculation, then I have to cover it with a single quote and bracket.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;%let num1= 1000;&lt;BR /&gt;%let num2= 1000 - 100;&lt;BR /&gt;%let output = ('&amp;amp;num1.','&amp;amp;num2.');&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need output like this:&lt;/P&gt;&lt;P&gt;('1000','900')&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 23:06:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/535769#M147155</guid>
      <dc:creator>bhu</dc:creator>
      <dc:date>2019-02-14T23:06:14Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate a macro variable with single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/535771#M147156</link>
      <description>&lt;P&gt;I found the solution:&lt;/P&gt;&lt;P&gt;%let num1 = '1000';&lt;BR /&gt;%let num2 = %sysevalf(%sysfunc(compress(&amp;amp;num1.,"'"))-10);&lt;BR /&gt;%let output = (&amp;amp;num1.,%tslit(&amp;amp;num2.));&lt;BR /&gt;%put &amp;amp;num1.;&lt;BR /&gt;%put &amp;amp;num2.;&lt;BR /&gt;%put &amp;amp;output.;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Feb 2019 23:13:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/535771#M147156</guid>
      <dc:creator>bhu</dc:creator>
      <dc:date>2019-02-14T23:13:37Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate a macro variable with single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/535831#M147180</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;%let num1= 1000;
%let num2= 1000 - 100;
%let output = (%bquote('&amp;amp;num1.','%eval(&amp;amp;num2.)'));

%put &amp;amp;output ;


&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 Feb 2019 12:02:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/535831#M147180</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-02-15T12:02:13Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate a macro variable with single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/535856#M147191</link>
      <description>&lt;P&gt;Hey&amp;nbsp; Xia&amp;nbsp;&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/18408"&gt;@Ksharp&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I know too well that you are intelligent. But unfortunately i am not,so&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please give me a hand to help my understanding if you have a couple of mins&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the %bquote here &lt;STRONG&gt;&lt;U&gt;force&lt;/U&gt; macro resolution&amp;nbsp; &lt;/STRONG&gt;inside &lt;STRONG&gt;'&amp;amp;var' &lt;/STRONG&gt;and then quote the value&lt;STRONG&gt;? &lt;/STRONG&gt;Is this behavior consistent?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am keen to understand how the macro processor works here.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for the bother if you are busy&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Feb 2019 14:21:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/535856#M147191</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-02-15T14:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: concatenate a macro variable with single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/536150#M147317</link>
      <description>&lt;P&gt;Hi. Thanks everything you do for sas communitity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;"Does the %bquote here &lt;STRONG&gt;&lt;U&gt;force&lt;/U&gt; macro resolution&amp;nbsp; &lt;/STRONG&gt;inside &lt;STRONG&gt;'&amp;amp;var' &lt;/STRONG&gt;and then quote the value&lt;STRONG&gt;? &lt;/STRONG&gt;Is this behavior consistent?"&lt;/P&gt;
&lt;P&gt;Answer is no. As far as I know %bquote firstly mask single quote , since quote has been masked ,then resolving&amp;nbsp; macro variable &amp;amp; var is nature thing ,as %let x=&amp;amp;var ;&amp;nbsp; .did .&lt;/P&gt;
&lt;P&gt;Hope this could give you some hint .&lt;/P&gt;</description>
      <pubDate>Sat, 16 Feb 2019 12:01:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/concatenate-a-macro-variable-with-single-quote/m-p/536150#M147317</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-02-16T12:01:02Z</dc:date>
    </item>
  </channel>
</rss>

