<?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: bquote VS str in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/bquote-VS-str/m-p/928097#M365177</link>
    <description>&lt;P&gt;Take this program&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let unknownContent = a,b,c;
%put NOTE: word 2 is %scan(%str(&amp;amp;unknownContent), 2, %str(,)); 
%put NOTE: word 2 is %scan(%bquote(&amp;amp;unknownContent), 2, %str(,));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As general rule, if you can see the "difficult" characters in your code use %STR as in the example of the %SCAN function third argument, the "," is a "difficult" character so we use %STR so it is not treated as part of the code, but just as a "normal" comma.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can not see the "difficult" characters in your code as in the second %SCAN example use %BQUOTE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a more detailed explanation check this blog post&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sgf/2014/08/15/macro-quoting-made-easy/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2014/08/15/macro-quoting-made-easy/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 13 May 2024 09:56:05 GMT</pubDate>
    <dc:creator>BrunoMueller</dc:creator>
    <dc:date>2024-05-13T09:56:05Z</dc:date>
    <item>
      <title>bquote VS str</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bquote-VS-str/m-p/928077#M365173</link>
      <description>&lt;P&gt;Can someone please explain difference between bquote and str in sas with a working example.I am aware of theoretical difference between them.&lt;/P&gt;
&lt;P&gt;But ,I want to understand with example which shows why str can't be used in place of bquote&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 05:43:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bquote-VS-str/m-p/928077#M365173</guid>
      <dc:creator>Sathya3</dc:creator>
      <dc:date>2024-05-13T05:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: bquote VS str</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bquote-VS-str/m-p/928096#M365176</link>
      <description>&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/mcrolref/1.0/p1780jrqrtwtw7n16x83peo2zpxr.htm," target="_blank" rel="noopener"&gt;https://documentation.sas.com/doc/en/mcrolref/1.0/p1780jrqrtwtw7n16x83peo2zpxr.htm,&lt;/A&gt; which says:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;%QUOTE and %NRQUOTE mask the same items as %STR and %NRSTR, respectively. However, %STR and %NRSTR mask constant text instead of a resolved value. And, %STR and %NRSTR work when a macro compiles, and %QUOTE and %NRQUOTE work when a macro executes.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Constant text is text which will not change. Resolved values are inside a macro variable, and could change when the value of the macro variable changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sgf/2014/08/15/macro-quoting-made-easy/" target="_blank" rel="noopener"&gt;https://blogs.sas.com/content/sgf/2014/08/15/macro-quoting-made-easy/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which says "If you can see the problem, it is a compile issue (use %str or %nrstr); otherwise, it is execution time (use %bquote or %superq)". Please see the examples.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 09:51:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bquote-VS-str/m-p/928096#M365176</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-05-13T09:51:07Z</dc:date>
    </item>
    <item>
      <title>Re: bquote VS str</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bquote-VS-str/m-p/928097#M365177</link>
      <description>&lt;P&gt;Take this program&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let unknownContent = a,b,c;
%put NOTE: word 2 is %scan(%str(&amp;amp;unknownContent), 2, %str(,)); 
%put NOTE: word 2 is %scan(%bquote(&amp;amp;unknownContent), 2, %str(,));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;As general rule, if you can see the "difficult" characters in your code use %STR as in the example of the %SCAN function third argument, the "," is a "difficult" character so we use %STR so it is not treated as part of the code, but just as a "normal" comma.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you can not see the "difficult" characters in your code as in the second %SCAN example use %BQUOTE.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For a more detailed explanation check this blog post&amp;nbsp;&lt;A href="https://blogs.sas.com/content/sgf/2014/08/15/macro-quoting-made-easy/" target="_blank"&gt;https://blogs.sas.com/content/sgf/2014/08/15/macro-quoting-made-easy/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 09:56:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bquote-VS-str/m-p/928097#M365177</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2024-05-13T09:56:05Z</dc:date>
    </item>
    <item>
      <title>Re: bquote VS str</title>
      <link>https://communities.sas.com/t5/SAS-Programming/bquote-VS-str/m-p/928137#M365181</link>
      <description>&lt;P&gt;For what very little it may be worth, If I find myself looking for the difference between any of the macro quoting functions the next step is to rethink the problem as I may be trying to "fix" something that would be better off not existing in the first place.&lt;/P&gt;</description>
      <pubDate>Mon, 13 May 2024 14:31:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/bquote-VS-str/m-p/928137#M365181</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2024-05-13T14:31:31Z</dc:date>
    </item>
  </channel>
</rss>

