<?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: Macro quoting (‘masking’) -  when is &amp;quot;unquoting done for you&amp;quot; in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/872033#M344504</link>
    <description>&lt;P&gt;Quentin,&lt;/P&gt;
&lt;P&gt;Many thanks for the quite valuable feedback and insight.&amp;nbsp;I do appreciate you doing a deep dive and providing additional references.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;“How the Macro Processor Executes a Compiled Macro” / “Restoring the Significance of Symbols” / Susan O’Connor pdf&lt;/P&gt;
&lt;P&gt;My recent observations also align with "the word scanner knowing how to handle delta characters and treating them as tokens when appropriate."&lt;/P&gt;
&lt;P&gt;Furthermore, not sure if you agree with this ad-hoc assessment&lt;/P&gt;
&lt;P&gt;"I’m not certain that the MP ever &amp;lt;directly&amp;gt; returns text to the WS.&amp;nbsp;The WS reads from the IB - aka Input Buffer/ Stack - (only and ever? ..aka “tokenizes the text”) and then sends any macro triggers to the MP."&lt;/P&gt;
&lt;P&gt;My walnut size SAS brain needs to still 'see it in context' so the attached Excel doc outlines two simple processes where one produces an error (due to NO unmasking) and the other one succeeds (due to unmasking). I believe this demonstrates 'in context':&lt;/P&gt;
&lt;P&gt;i)&amp;nbsp; &amp;nbsp;that indeed the WS can handle delta characters (and would still send a masked value to the IB)&lt;/P&gt;
&lt;P&gt;ii)&amp;nbsp; that 'unquoting' / 'unmasking' is required at times (it cannot always "be done for you")&amp;nbsp;&lt;/P&gt;
&lt;P&gt;iii) exactly where the compile-time error occurs&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 25 Apr 2023 21:28:39 GMT</pubDate>
    <dc:creator>Rampsas1</dc:creator>
    <dc:date>2023-04-25T21:28:39Z</dc:date>
    <item>
      <title>Macro quoting (‘masking’) -  when is "unquoting done for you"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/871338#M344189</link>
      <description>&lt;P&gt;Base SAS 9.4.&lt;/P&gt;
&lt;P&gt;I am trying to thoroughly understand Macro Quoting (‘masking’) within the context of ‘SAS Processing’ (Input Buffer / Word Scanner / Macro Processor / Symbol Tables (in this case Global only) / Macro Catalog / Compiler)&lt;/P&gt;
&lt;P&gt;SAS code examples provided are quite simple but I am trying to breakdown the SAS Process to determine exactly where &lt;FONT color="#FF0000"&gt;"unquoting is done for you"&lt;/FONT&gt; as referenced below.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;FYI: I really could not find a more abbreviated manner in which to breakdown the various parts of the SAS Process .... so thanks in advance.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* EXAMPLE 1 */
%let mv1=data test; var='a'; run; 
%put &amp;amp;=mv1;
%put _user_;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I understand why Example 1 would fail&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Macro Processor&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;begins to 'execute' the %let statement&lt;/P&gt;
&lt;P&gt;adds MV1 to Global Symbol Table&lt;/P&gt;
&lt;P&gt;mv1&amp;nbsp;&amp;nbsp;&amp;nbsp; data test (&amp;lt;&amp;lt; no semi)&lt;/P&gt;
&lt;P&gt;The ';' represents an end of statement&lt;/P&gt;
&lt;P&gt;&amp;nbsp;";var='a'; run;" is never added to the GST&lt;/P&gt;
&lt;P&gt;&lt;FONT size="2" color="#0000FF"&gt;ERROR 180-322: Statement is not valid or it is used out of proper order.&lt;/FONT&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* EXAMPLE 2 */
%let mv2=%str(data test; var='a'; run;); 
%put _user_; 
%put &amp;amp;=mv2;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I understand why we need to use masking as in Example 2&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Macro Processor&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;begins to 'execute' the %let statement&lt;/P&gt;
&lt;P&gt;adds MV2 (masked) to Global Symbol Table&lt;/P&gt;
&lt;P&gt;mv2&amp;nbsp;&amp;nbsp;&amp;nbsp; data test; var='a'; run;&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt; NOTE: %put _user_;&amp;nbsp; 'shows us' those delta characters&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* create macro variable*/
%let mv3=%str(data test; var='a'; run;); 
%put _user_; 
%put &amp;amp;=mv3;

/* Example 3a)*/
%macro test;
%put _user_;
&amp;amp;mv3;
%mend test;
%test;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;I might expect that Example 3a would fail (given that there is no explicit %unquote to ‘unmask’ mv3 (the masked string found in the Global Symbol Table)).&lt;/P&gt;
&lt;P&gt;However, does Example 3a fall under &lt;FONT color="#FF0000"&gt;this description&lt;/FONT&gt; (from a SAS blog)?&lt;/P&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; There are three cases where the &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;unquoting is done for you&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The %UNQUOTE function was used&lt;/LI&gt;
&lt;LI&gt;&lt;FONT color="#FF0000"&gt;The item leaves the word scanner and is passed to the DATA step compiler, SAS Macro Facility, or other parts of the SAS System.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;The value is returned from the %SCAN, %SUBSTR, or %UPCASE function&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;And, thus Example 3b (with explicit %unquote) further below is just not necessary?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have tried to breakdown Example 3a) below in the context of SAS Processing to understand precisely where&amp;nbsp;&lt;FONT color="#FF0000"&gt;'&lt;STRONG&gt;&lt;EM&gt;unquoting is done for you'&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;NOTE: the masked string&amp;nbsp;mv3=%str(data test; var='a'; run;);&amp;nbsp;..&amp;nbsp;already exists in the Global Symbol Table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input Buffer&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;%macro test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;amp;mv3;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;%mend test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;%test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Word Scanner&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;detects %macro key word&lt;/P&gt;
&lt;P&gt;MP is triggered&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Macro Processor&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;During macro compilation&lt;/P&gt;
&lt;P&gt;creates entry in the Macro Catalog&lt;/P&gt;
&lt;P&gt;pulls tokens from the Input Buffer to the Macro Catalog until %mend&lt;/P&gt;
&lt;P&gt;&amp;gt; %IF etc. as macro instructions&lt;/P&gt;
&lt;P&gt;&amp;gt; noncompiled items as text&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Macro Catalog&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;%macro test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;amp;mv3;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;%mend test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input Buffer&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;%test;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Word Scanner&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;detects % trigger&lt;/P&gt;
&lt;P&gt;Macro Processor is triggered&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Macro Processor&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;begins to execute the macro&lt;/P&gt;
&lt;P&gt;recognizes non-compiled text&lt;/P&gt;
&lt;P&gt;places &amp;amp;mv2 into the IB&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input Buffer&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;amp;mv3.;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Word Scanner&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;continues to tokenize from the IB&lt;/P&gt;
&lt;P&gt;recognizes macro trigger '&amp;amp;'&lt;/P&gt;
&lt;P&gt;triggers MP&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;Is it here that the 'item' (the masked string from the Global Symbol Table) leaves the word scanner and is passed to the SAS Macro Facility and therefore, ‘unquoting is done for you’?&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Macro Processor&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;looks in Local (and then Global) Symbol Table and resolves &amp;amp;mv2&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;&amp;gt;&amp;gt;&amp;gt; mv3 is now clearly unmasked &amp;lt;&amp;lt;&amp;lt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;&amp;amp;mv3; &amp;gt;&amp;gt;&amp;gt; (data test; var='a'; run;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;places non-compiled text into the Input Buffer&lt;/P&gt;
&lt;P&gt;recognizes %mend&lt;/P&gt;
&lt;P&gt;macro test ceases execution&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Input Buffer&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;data test; var='a'; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Word Scanner&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;continues to tokenize from the IB&lt;/P&gt;
&lt;P&gt;recognizes DATA as step boundary&lt;/P&gt;
&lt;P&gt;triggers the DATA step compiler&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;U&gt;Compiler&lt;/U&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000FF"&gt;data test; var='a'; run;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;The compiled DATA step is executed&lt;/P&gt;
&lt;P&gt;The DATA step compiler is cleared&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Therefore, Example 3b (where %unquote is explicit) is just not needed?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;/* Example 3b)*/
%macro test;
%put _user_;
%unquote(&amp;amp;mv3);
%mend test;
%test;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2023 18:19:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/871338#M344189</guid>
      <dc:creator>Rampsas1</dc:creator>
      <dc:date>2023-04-22T18:19:00Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting (‘masking’) -  when is "unquoting done for you"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/871345#M344195</link>
      <description>&lt;P&gt;Have you seen this ??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Quoting in SAS® Macro Programming Q&amp;amp;A, Slides, and On-Demand Recording&lt;BR /&gt;Started ‎10-19-2022&lt;BR /&gt;Modified ‎10-19-2022&lt;BR /&gt;Views 924&lt;BR /&gt;&lt;A href="https://communities.sas.com/t5/Ask-the-Expert/Quoting-in-SAS-Macro-Programming-Q-amp-A-Slides-and-On-Demand/ta-p/839431" target="_blank"&gt;https://communities.sas.com/t5/Ask-the-Expert/Quoting-in-SAS-Macro-Programming-Q-amp-A-Slides-and-On-Demand/ta-p/839431&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Koen&lt;/P&gt;</description>
      <pubDate>Sat, 22 Apr 2023 18:38:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/871345#M344195</guid>
      <dc:creator>sbxkoenk</dc:creator>
      <dc:date>2023-04-22T18:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting (‘masking’) -  when is "unquoting done for you"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/871465#M344270</link>
      <description>&lt;P&gt;Hmm, I don't really like your second unquoting rule:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;
&lt;P&gt;&amp;gt;&amp;gt;&amp;gt; There are three cases where the &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;&lt;EM&gt;unquoting is done for you&lt;/EM&gt;&lt;/STRONG&gt;&lt;/FONT&gt;:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;The %UNQUOTE function was used&lt;/LI&gt;
&lt;LI&gt;&lt;FONT color="#FF0000"&gt;The item leaves the word scanner and is passed to the DATA step compiler, SAS Macro Facility, or other parts of the SAS System.&lt;/FONT&gt;&lt;/LI&gt;
&lt;LI&gt;The value is returned from the %SCAN, %SUBSTR, or %UPCASE function&lt;/LI&gt;
&lt;/UL&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;But it's consistent with what I see in the docs:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1f5qisx8mv9ygn1dikmgba1lmmu.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1f5qisx8mv9ygn1dikmgba1lmmu.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here's how I think about it.&amp;nbsp; Macro quoting is part of the macro language.&amp;nbsp; Macro quoting symbols have no meaning outside of the macro language.&amp;nbsp; Therefore, when the macro processor returns text to the word scanner, it should automatically unquote the text.&amp;nbsp; This is necessary so that the word scanner can appropriately build tokens for the DATA step compiler, PROC interpreter, or whatever part of SAS is appropriate.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So in my head, when you code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let mv3=%str(data test; var='a'; run;); 

%macro test;
%put _user_;
&amp;amp;mv3
%mend test;
%test;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It makes sense that it works, because the macro processor unmasks the semicolons before sending them to the word scanner.&amp;nbsp; So the macro processor resolves the reference to MV3, and gets a value with quoting symbols in it.&amp;nbsp; Then when it returns that value to the word scanner, it unmasks the semicolons.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suppose it's possible that the word scanner is doing the unquoting (as the docs suggest), but that doesn't really help with my understanding of the process.&amp;nbsp; And as these are all logical constructs, I'm happy to stick with the idea that the macro processor is responsible for unquoting values before returning them to SAS.&lt;/P&gt;</description>
      <pubDate>Sun, 23 Apr 2023 21:36:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/871465#M344270</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-04-23T21:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting (‘masking’) -  when is "unquoting done for you"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/871579#M344321</link>
      <description>&lt;P&gt;I've been thinking about this more, and reading more, and I think your post, and the documentation, are correct that it is the word scanner that is doing the unquoting. not the macro processor.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This part of docs has a nice walk through of the macro execution process, showing what is returned to the input stack, etc. I think it agrees with your writeup. It doesn't address quoting.&amp;nbsp; &amp;nbsp;&lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p0eksviivbw6bwn1eg6h2crvl7ct.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p0eksviivbw6bwn1eg6h2crvl7ct.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This page of the docs seems pretty clear that the word scanner is doing unquoting before passing tokens on, which still surprises me. But I guess it's believable. &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1f5qisx8mv9ygn1dikmgba1lmmu.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/p1f5qisx8mv9ygn1dikmgba1lmmu.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This page of the docs says the macro processor does the un-quoting: "When the macro processor is finished with a macro quoted text string, it removes the macro quoting-coded substitute characters and replaces them with the original characters. The unmasked characters are passed on to the rest of the system."&amp;nbsp; &lt;A href="https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0tmct0ywyatobn19gdnxdjvpa89.htm" target="_blank"&gt;https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/mcrolref/n0tmct0ywyatobn19gdnxdjvpa89.htm&lt;/A&gt; That's how I like to think about it. But I think it's wrong (at least it's inconsistent with the other part of the docs).&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Susan O'Connor wrote one of the foundational papers on macro quoting, which includes this statement: "The word scanner knows how to handle delta characters and treats them as tokens when appropriate." &lt;A href="https://www.lexjansen.com/nesug/nesug99/bt/bt185.pdf" target="_blank"&gt;https://www.lexjansen.com/nesug/nesug99/bt/bt185.pdf&lt;/A&gt;&amp;nbsp;So that is consistent with the documentation saying it is the word scanner, not the macro processor, which does unquoting.&amp;nbsp; If the macro processor did the unquoting, the word scanner would not need to know about delta characters. Since you're interested in macro quoting, definitely read this paper.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My other favorite macro quoting paper is Ian Whitock's:&lt;A href="https://support.sas.com/resources/papers/proceedings/proceedings/sugi28/011-28.pdf" target="_blank"&gt;&amp;nbsp;https://support.sas.com/resources/papers/proceedings/proceedings/sugi28/011-28.pdf&lt;/A&gt;&amp;nbsp;. That paper suggests that macro facility is doing the unquoting (but this paper never mentions the word scanner, so perhaps this is an intentional over-simplification).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In a sense, I think it doesn't really matter whether the macro processor unquotes values, or the word scanner unquotes them.&amp;nbsp; It's even possible that they could work together on unquoting, and as new versions of SAS were released, the implementation of how unquoting is handled may have evolved.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2023 13:30:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/871579#M344321</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-04-24T13:30:43Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting (‘masking’) -  when is "unquoting done for you"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/872013#M344503</link>
      <description>Sbxkoenk: Thanks for the reference .. very insightful</description>
      <pubDate>Tue, 25 Apr 2023 20:51:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/872013#M344503</guid>
      <dc:creator>Rampsas1</dc:creator>
      <dc:date>2023-04-25T20:51:41Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting (‘masking’) -  when is "unquoting done for you"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/872033#M344504</link>
      <description>&lt;P&gt;Quentin,&lt;/P&gt;
&lt;P&gt;Many thanks for the quite valuable feedback and insight.&amp;nbsp;I do appreciate you doing a deep dive and providing additional references.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;“How the Macro Processor Executes a Compiled Macro” / “Restoring the Significance of Symbols” / Susan O’Connor pdf&lt;/P&gt;
&lt;P&gt;My recent observations also align with "the word scanner knowing how to handle delta characters and treating them as tokens when appropriate."&lt;/P&gt;
&lt;P&gt;Furthermore, not sure if you agree with this ad-hoc assessment&lt;/P&gt;
&lt;P&gt;"I’m not certain that the MP ever &amp;lt;directly&amp;gt; returns text to the WS.&amp;nbsp;The WS reads from the IB - aka Input Buffer/ Stack - (only and ever? ..aka “tokenizes the text”) and then sends any macro triggers to the MP."&lt;/P&gt;
&lt;P&gt;My walnut size SAS brain needs to still 'see it in context' so the attached Excel doc outlines two simple processes where one produces an error (due to NO unmasking) and the other one succeeds (due to unmasking). I believe this demonstrates 'in context':&lt;/P&gt;
&lt;P&gt;i)&amp;nbsp; &amp;nbsp;that indeed the WS can handle delta characters (and would still send a masked value to the IB)&lt;/P&gt;
&lt;P&gt;ii)&amp;nbsp; that 'unquoting' / 'unmasking' is required at times (it cannot always "be done for you")&amp;nbsp;&lt;/P&gt;
&lt;P&gt;iii) exactly where the compile-time error occurs&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 21:28:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/872033#M344504</guid>
      <dc:creator>Rampsas1</dc:creator>
      <dc:date>2023-04-25T21:28:39Z</dc:date>
    </item>
    <item>
      <title>Re: Macro quoting (‘masking’) -  when is "unquoting done for you"</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/872043#M344506</link>
      <description>&lt;P&gt;Yes, I would agree with:&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;HR /&gt;"I’m not certain that the MP ever &amp;lt;directly&amp;gt; returns text to the WS.&amp;nbsp;The WS reads from the IB - aka Input Buffer/ Stack - (only and ever? ..aka “tokenizes the text”)&amp;nbsp;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Here's another reference. The great Russ Lavery has a series of "animated guide" talks where he shows various processes in action.&amp;nbsp; He has an animated guide talk for macro quoting.&amp;nbsp; The paper is:&amp;nbsp;&lt;A href="https://www.lexjansen.com/wuss/2016/134_Final_Paper_PDF.pdf" target="_blank"&gt;https://www.lexjansen.com/wuss/2016/134_Final_Paper_PDF.pdf&lt;/A&gt;&amp;nbsp;.&amp;nbsp; But the paper doesn't do it justice.&amp;nbsp; It's a thing of beauty to watch an animated powerpoint slide showing code and tokens flowing from the input stack, through the word scanner, and beyond.&amp;nbsp; If you ever hear of Russ doing that talk live, you don't want to miss it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Good luck on your macro adventure.&amp;nbsp; it's fun stuff!&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2023 21:41:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Macro-quoting-masking-when-is-quot-unquoting-done-for-you-quot/m-p/872043#M344506</guid>
      <dc:creator>Quentin</dc:creator>
      <dc:date>2023-04-25T21:41:25Z</dc:date>
    </item>
  </channel>
</rss>

