<?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: Programming in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834728#M329965</link>
    <description>&lt;P&gt;If you can use double quotes (as you should be able to in normal SAS code) then just use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put "&amp;amp;q_start_date";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need the single quotes use %bquote().&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %bquote('&amp;amp;q_start_date');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the macro quoting added by %BQUOTE() causes trouble remove it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %unquote(%bquote('&amp;amp;q_start_date'));&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 22 Sep 2022 19:39:35 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2022-09-22T19:39:35Z</dc:date>
    <item>
      <title>Resolve macro variable with quotes</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834724#M329962</link>
      <description>&lt;P&gt;How can I accomplish the following:&lt;BR /&gt;%put &amp;amp;q_start_date --&amp;gt; resolves to 01MAR2022&lt;BR /&gt;what I need the variable to resolve to is '01MAR2022'&lt;/P&gt;
&lt;P&gt;Can anyone help me with the issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 06:38:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834724#M329962</guid>
      <dc:creator>cca8380</dc:creator>
      <dc:date>2022-09-23T06:38:22Z</dc:date>
    </item>
    <item>
      <title>Macro variable value</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834725#M329963</link>
      <description>&lt;P&gt;Better to apply the quotes when the macro variable is used, rather than include the quotes in the macro variable value. So when the macro variable is used, for example in a DATA step, you can do something like this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if date &amp;gt; "&amp;amp;q_start_date"d then ... ;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If that's not what you are looking for, please be more specific about how this macro variable will be used.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2022 19:20:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834725#M329963</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-09-22T19:20:05Z</dc:date>
    </item>
    <item>
      <title>Re: Programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834727#M329964</link>
      <description>How are you creating the macro variable? Usually fixing it in that step is preferable. And why are single quotes needed? Double quotes will allow a macro variable to resolve correctly.</description>
      <pubDate>Thu, 22 Sep 2022 19:29:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834727#M329964</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2022-09-22T19:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: Programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834728#M329965</link>
      <description>&lt;P&gt;If you can use double quotes (as you should be able to in normal SAS code) then just use:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put "&amp;amp;q_start_date";&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you need the single quotes use %bquote().&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %bquote('&amp;amp;q_start_date');&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If the macro quoting added by %BQUOTE() causes trouble remove it.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%put %unquote(%bquote('&amp;amp;q_start_date'));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 22 Sep 2022 19:39:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834728#M329965</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-09-22T19:39:35Z</dc:date>
    </item>
    <item>
      <title>Re: Programming</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834790#M329994</link>
      <description>&lt;P&gt;How do you intend to use the macro variable? If you need it for comparisons or calculations, store the raw date value. See Maxim 28.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Sep 2022 03:06:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Resolve-macro-variable-with-quotes/m-p/834790#M329994</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-09-23T03:06:39Z</dc:date>
    </item>
  </channel>
</rss>

