<?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: Unquoting in SAS in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Unquoting-in-SAS/m-p/202391#M37738</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically needed when you had to %quote (or other functions) because the string you are manipulating has special characters such as % or &amp;amp; that are not macro function or variables (at least at that point in the program) that you do not want resolved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the documentation see the difference in these two data steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let val = aaa;&lt;/P&gt;&lt;P&gt;%let testval = %str(%'&amp;amp;val%');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; val = &amp;amp;testval;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'VAL =' val;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; val = %unquote(&amp;amp;testval);&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'VAL =' val;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to avoid macro quoting as much as practical as it often means I've complicated issues somewhere along the line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Aug 2015 15:28:47 GMT</pubDate>
    <dc:creator>ballardw</dc:creator>
    <dc:date>2015-08-19T15:28:47Z</dc:date>
    <item>
      <title>Unquoting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unquoting-in-SAS/m-p/202390#M37737</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Forum,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; Use of %unquote is not&amp;nbsp; necessary even though it is quoted with %str in code below (Automatic unquoting).&amp;nbsp; I wonder under which conditions %unquote is explicitly required to get the resolved value back.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options symbolgen;&lt;/P&gt;&lt;P&gt;%let macvar=%str(proc print;run;);&lt;/P&gt;&lt;P&gt;%put &amp;amp;macvar;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable MACVAR resolves to proc print;run;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Some characters in the above value which were subject to macro&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; quoting have been unquoted for printing.&lt;/P&gt;&lt;P&gt;proc print;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 15:22:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unquoting-in-SAS/m-p/202390#M37737</guid>
      <dc:creator>kaushal2040</dc:creator>
      <dc:date>2015-08-19T15:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Unquoting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unquoting-in-SAS/m-p/202391#M37738</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Basically needed when you had to %quote (or other functions) because the string you are manipulating has special characters such as % or &amp;amp; that are not macro function or variables (at least at that point in the program) that you do not want resolved.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;From the documentation see the difference in these two data steps:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let val = aaa;&lt;/P&gt;&lt;P&gt;%let testval = %str(%'&amp;amp;val%');&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; val = &amp;amp;testval;&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'VAL =' val;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;&amp;nbsp; val = %unquote(&amp;amp;testval);&lt;/P&gt;&lt;P&gt;&amp;nbsp; put 'VAL =' val;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I try to avoid macro quoting as much as practical as it often means I've complicated issues somewhere along the line.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 15:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unquoting-in-SAS/m-p/202391#M37738</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2015-08-19T15:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: Unquoting in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Unquoting-in-SAS/m-p/202392#M37739</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, ballardw.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This example explains a lot.&amp;nbsp; I understand when there are macro triggers masked in macro variable then %unquote is required to get resolved value.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Aug 2015 16:57:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Unquoting-in-SAS/m-p/202392#M37739</guid>
      <dc:creator>kaushal2040</dc:creator>
      <dc:date>2015-08-19T16:57:19Z</dc:date>
    </item>
  </channel>
</rss>

