<?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: Why is Special Tokens not being displayed in the log when using %put _user_? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865043#M341592</link>
    <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/431484"&gt;@Nietzsche&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;okay, just read about %bquote, which seems to be so much easier than %str.&lt;/P&gt;
&lt;P&gt;is there any point in using %str over %bquote?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%bquote and %str do different things. They are not interchangeable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In simple terms, %str() masks special characters that you can see in the argument. For example, if you have a plus sign in the argument, you would need %str. You could use &lt;FONT face="courier new,courier"&gt;%str(Dan+Shay)&lt;/FONT&gt;, you can see the + sign in the argument to the %str() function, and so the %str() function will treat the plus sign as text and not as addition; and quoting functions will not help here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%bquote masks special characters that you cannot see in a macro variable. If a macro variable &amp;amp;A contains values with a plus sign, then the %str(&amp;amp;A) will not work, you cannot see the plus sign; you will need &lt;FONT face="courier new,courier"&gt;%bquote(&amp;amp;a)&lt;/FONT&gt; to prevent the plus sign from being interpreted as addition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 18 Mar 2023 10:01:01 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-03-18T10:01:01Z</dc:date>
    <item>
      <title>Why is Special Tokens not being displayed in the log when using %put _user_?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865010#M341568</link>
      <description>&lt;P&gt;hello, learning about masking special tokens in Macro Variables in the Advanced prep guide 4e. pg 304.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_0-1679103501072.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81739i73CBD3D64BB16A12/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nietzsche_0-1679103501072.png" alt="Nietzsche_0-1679103501072.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I reference the macro variable with %put &amp;amp;prog; it shows the special token ";" in the log.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_1-1679103595337.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81740iCD838ACCCA3EA1AB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nietzsche_1-1679103595337.png" alt="Nietzsche_1-1679103595337.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But if I use&amp;nbsp;%put _user_; or %put _all_;&amp;nbsp; &amp;nbsp;special token ";" is missing.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_2-1679103673133.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81741i10FB014A46B5D172/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nietzsche_2-1679103673133.png" alt="Nietzsche_2-1679103673133.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;why is that?&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 01:41:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865010#M341568</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2023-03-18T01:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Special Tokens not being displayed in the log when using %put _user_?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865014#M341571</link>
      <description>&lt;P&gt;okay, just read about %bquote, which seems to be so much easier than %str.&lt;/P&gt;
&lt;P&gt;is there any point in using %str over %bquote?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Nietzsche_0-1679104986883.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81742iB02DC88E3152E59D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Nietzsche_0-1679104986883.png" alt="Nietzsche_0-1679104986883.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 02:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865014#M341571</guid>
      <dc:creator>Nietzsche</dc:creator>
      <dc:date>2023-03-18T02:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Special Tokens not being displayed in the log when using %put _user_?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865017#M341572</link>
      <description>&lt;P&gt;Because that is how it works.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you look carefully at the output of %PUT _USER_ you can see the special bytes that indicate the macro quoting.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Tom_0-1679108330504.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/81743iB7268CD4FD3C65BA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Tom_0-1679108330504.png" alt="Tom_0-1679108330504.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;And if you look at how it is surfaced by SASHELP.VMACRO you can see it also.&lt;/P&gt;
&lt;PRE&gt;2045  data _null_;
2046    set sashelp.vmacro;
2047    where name='XX';
2048    put value / value :$hex36. ;
2049  run;

&amp;#1;data one&amp;#14; run&amp;#14;&amp;#2;
0164617461206F6E650E2072756E0E022020
NOTE: There were 1 observations read from the data set SASHELP.VMACRO.
      WHERE name='XX';
&lt;/PRE&gt;</description>
      <pubDate>Sat, 18 Mar 2023 03:02:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865017#M341572</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-03-18T03:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Special Tokens not being displayed in the log when using %put _user_?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865043#M341592</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/431484"&gt;@Nietzsche&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;okay, just read about %bquote, which seems to be so much easier than %str.&lt;/P&gt;
&lt;P&gt;is there any point in using %str over %bquote?&amp;nbsp;&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%bquote and %str do different things. They are not interchangeable.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In simple terms, %str() masks special characters that you can see in the argument. For example, if you have a plus sign in the argument, you would need %str. You could use &lt;FONT face="courier new,courier"&gt;%str(Dan+Shay)&lt;/FONT&gt;, you can see the + sign in the argument to the %str() function, and so the %str() function will treat the plus sign as text and not as addition; and quoting functions will not help here.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;%bquote masks special characters that you cannot see in a macro variable. If a macro variable &amp;amp;A contains values with a plus sign, then the %str(&amp;amp;A) will not work, you cannot see the plus sign; you will need &lt;FONT face="courier new,courier"&gt;%bquote(&amp;amp;a)&lt;/FONT&gt; to prevent the plus sign from being interpreted as addition.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 10:01:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865043#M341592</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-03-18T10:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Special Tokens not being displayed in the log when using %put _user_?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865063#M341600</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/431484"&gt;@Nietzsche&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;okay, just read about %bquote, which seems to be so much easier than %str.&lt;/P&gt;
&lt;P&gt;is there any point in using %str over %bquote? '&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;This is a good question, but I suggest you make it a separate question.&amp;nbsp; It's deserving of its own thread.&amp;nbsp; The differences between %BQUOTE and %STR become clearer in the the context of a macro.&amp;nbsp; In open code (outside of a macro definition), there are people who use %BQUOTE in situations where %STR could be used.&amp;nbsp; But inside a macro definition, %BQUOTE and %STR do different things.&lt;/P&gt;</description>
      <pubDate>Sat, 18 Mar 2023 23:02:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865063#M341600</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-03-18T23:02:10Z</dc:date>
    </item>
    <item>
      <title>Re: Why is Special Tokens not being displayed in the log when using %put _user_?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865112#M341625</link>
      <description>&lt;P&gt;I recommend you this article by Susan O'Connor about macro quoting:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://stats.oarc.ucla.edu/wp-content/uploads/2016/02/bt185.pdf" target="_blank"&gt;https://stats.oarc.ucla.edu/wp-content/uploads/2016/02/bt185.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;it's only 12 pages, so reads fast, but explains everything perfectly, especially differences between %str() and %bquote().&lt;/P&gt;
&lt;P&gt;I'm sure&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/19879"&gt;@Quentin&lt;/a&gt;&amp;nbsp;will agree on that.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bart&lt;/P&gt;</description>
      <pubDate>Sun, 19 Mar 2023 20:25:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Why-is-Special-Tokens-not-being-displayed-in-the-log-when-using/m-p/865112#M341625</guid>
      <dc:creator>yabwon</dc:creator>
      <dc:date>2023-03-19T20:25:08Z</dc:date>
    </item>
  </channel>
</rss>

