<?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: I need to resolve macro variable in single quotation in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610385#M177749</link>
    <description>&lt;P&gt;&lt;A href="https://github.com/scottbass/SAS/blob/master/Macro/squote.sas" target="_blank" rel="noopener"&gt;https://github.com/scottbass/SAS/blob/master/Macro/squote.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.: Your particular example is poor - you'd just replace the single quotes with double quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll run with your subject line and not your example.&lt;/P&gt;</description>
    <pubDate>Mon, 09 Dec 2019 06:48:16 GMT</pubDate>
    <dc:creator>ScottBass</dc:creator>
    <dc:date>2019-12-09T06:48:16Z</dc:date>
    <item>
      <title>I need to resolve macro variable in single quotation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610384#M177748</link>
      <description>%let name=jhonson;&lt;BR /&gt;&lt;BR /&gt;Data ex1;&lt;BR /&gt;Myname=%str('&amp;amp;name') ;&lt;BR /&gt;Run;&lt;BR /&gt;&lt;BR /&gt;If I am running the above program the macro variable is not resolving within single quotation</description>
      <pubDate>Mon, 09 Dec 2019 06:41:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610384#M177748</guid>
      <dc:creator>thanikondharish</dc:creator>
      <dc:date>2019-12-09T06:41:53Z</dc:date>
    </item>
    <item>
      <title>Re: I need to resolve macro variable in single quotation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610385#M177749</link>
      <description>&lt;P&gt;&lt;A href="https://github.com/scottbass/SAS/blob/master/Macro/squote.sas" target="_blank" rel="noopener"&gt;https://github.com/scottbass/SAS/blob/master/Macro/squote.sas&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S.: Your particular example is poor - you'd just replace the single quotes with double quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll run with your subject line and not your example.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 06:48:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610385#M177749</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-12-09T06:48:16Z</dc:date>
    </item>
    <item>
      <title>Re: I need to resolve macro variable in single quotation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610391#M177752</link>
      <description>&lt;P&gt;Why do you need single quotes? Please show us the (complete) desired end result.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 07:18:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610391#M177752</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-12-09T07:18:16Z</dc:date>
    </item>
    <item>
      <title>Re: I need to resolve macro variable in single quotation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610406#M177756</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/209685"&gt;@thanikondharish&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does that answer your question?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let name=jhonson;

Data ex1;
Myname = compress(catx("","'","&amp;amp;name","'")) ;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Dec 2019 08:30:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610406#M177756</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-09T08:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: I need to resolve macro variable in single quotation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610407#M177757</link>
      <description>&lt;P&gt;you cannot resolve the &amp;amp;name or any macro variable with single quote, we need to use the double quotes to resolve the macro variables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 08:33:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610407#M177757</guid>
      <dc:creator>Jagadishkatam</dc:creator>
      <dc:date>2019-12-09T08:33:53Z</dc:date>
    </item>
    <item>
      <title>Re: I need to resolve macro variable in single quotation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610426#M177762</link>
      <description>&lt;P&gt;Macro expressions in single quotes are not resolved. There are several ways to get you the result you want, one is to use double quotes as&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/15043"&gt;@ScottBass&lt;/a&gt;&amp;nbsp;suggested:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data ex1;
Myname="&amp;amp;name" ;
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Another is to use the SYMGET function to get the value:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data ex1;
Myname=symget('NAME');
Run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you absolutely need to get the macro value in single quotes, the easiest is probably to use the QUOTE function:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;Data ex1;
Myname=%sysfunc(quote(&amp;amp;name,%str(%'))) ;
Run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 09 Dec 2019 09:56:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610426#M177762</guid>
      <dc:creator>s_lassen</dc:creator>
      <dc:date>2019-12-09T09:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: I need to resolve macro variable in single quotation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610429#M177764</link>
      <description>&lt;P&gt;If you add outer double quotes, the macro variable reference will be resolved despite the inner single quotes:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data ex1;
Myname="'&amp;amp;name'";
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This assumes that you want the single quotes to be part of the string stored in the character variable.&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 10:18:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610429#M177764</guid>
      <dc:creator>FreelanceReinh</dc:creator>
      <dc:date>2019-12-09T10:18:00Z</dc:date>
    </item>
    <item>
      <title>Re: I need to resolve macro variable in single quotation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610584#M177819</link>
      <description>&lt;P&gt;I just borrowed (stole?) Tom's original work for my macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;See&amp;nbsp;&lt;SPAN&gt;&lt;A href="https://communities.sas.com/t5/SAS-Communities-Library/Not-All-Macro-Language-Elements-Are-Supported-by-the-Macro/ta-p/223904.&amp;nbsp;" target="_blank"&gt;https://communities.sas.com/t5/SAS-Communities-Library/Not-All-Macro-Language-Elements-Are-Supported-by-the-Macro/ta-p/223904.&amp;nbsp;&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 09 Dec 2019 23:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610584#M177819</guid>
      <dc:creator>ScottBass</dc:creator>
      <dc:date>2019-12-09T23:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: I need to resolve macro variable in single quotation</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610599#M177826</link>
      <description>&lt;P&gt;At this point, the answers have been given to the question asked; but I think the real question that needs an answer is why do you want to resolve a macro variable in single quotes in the first place? This seems like a misunderstanding and could have been easily solved if only you told us what the real goal of the program and explained where you are and where you want to go, rather than you want to resolve a macro in single quotes.&lt;/P&gt;</description>
      <pubDate>Tue, 10 Dec 2019 02:10:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-resolve-macro-variable-in-single-quotation/m-p/610599#M177826</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2019-12-10T02:10:33Z</dc:date>
    </item>
  </channel>
</rss>

