<?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: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160126#M31140</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick response Tom.&amp;nbsp; I'm familiar with how the macro processor handles delimiters and that's why I don't understand the behavior I'm seeing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When used with a single ampersand macro variable two dots resolve as a single dot.&amp;nbsp;&amp;nbsp; But the attachment shows that when used with a double-ampersand macro variable two dots resolve to a blank and three dots resolve to blank-dot.&amp;nbsp; I'm wondering why.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 25 Sep 2014 17:03:19 GMT</pubDate>
    <dc:creator>bentleyj1</dc:creator>
    <dc:date>2014-09-25T17:03:19Z</dc:date>
    <item>
      <title>Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160124#M31138</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm using the macro facility to generate SQL that is passed to Oracle for execution and I'm using the macro variable &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n holds Oracle table names.&amp;nbsp; So far so good.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I use &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n in the query's FROM clause to conditionally specify how to Join the tables involved.&amp;nbsp; I've used macro variables with double-ampersands before but never in this particular way.&amp;nbsp; It works but with some strange behavior.&amp;nbsp; Here we see the double-ampersand macro variable table name separated by two dots from the field name,&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;%if &amp;amp;_nUniqTables &amp;gt;= 1 %then %do _n=1 %to &amp;amp;_nUniqTables;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and base.clnt_num=&amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n..clnt_nr &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and trim(base.loan_num)=&amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n..ln_nr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My experience is that two dots as a delimiter following a macro variable resolves as one dot, and I use that construct frequently to specify a table.fieldname such as &amp;amp;_table1..&amp;amp;_field1 -- this will resolve properly as customer_info.customer_name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The problem with the code above is that two dots following the double-ampersand macro variable resolves as a blank and so throws an error (see the attachment).&amp;nbsp; One dot as a delimiter resolves as no delimiter (as expected), and three dots resolves to a blank followed by a dot.&amp;nbsp; Four dots resolves to blank-dot-dot&amp;nbsp;&amp;nbsp; The query works with blank-dot to separate table and field so I can live with that but I'd sure like to understand why it resolves like that.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attached log snippet shows the entire query and Error messages for one, two, three and four dots at the delimiter.&amp;nbsp; I haven't asked SAS Support about it yet.&amp;nbsp; Can anyone explain what's going on?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using explicit SQL pass-thru via execute ( &amp;lt;query&amp;gt; ) by oracle;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 16:31:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160124#M31138</guid>
      <dc:creator>bentleyj1</dc:creator>
      <dc:date>2014-09-25T16:31:17Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160125#M31139</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just add another dot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The reason for using extra dots is that the dot has special meaning to the macro processor.&amp;nbsp; You can use it to indicate the end of the macro variable name.&amp;nbsp; For example if you want to use a macro variable to hold the beginning of the name and then make the rest of the name be hard coded.&amp;nbsp; The dot lets the macro processor know that the other characters are not part of the macro variable name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;%let basename=age ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;&amp;amp;basename._squared = &amp;amp;basename ** 2;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;...&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So when you wanted variable X to hold the database (or schema) name you would write code like this to reference table A in that database.&lt;/P&gt;&lt;P&gt;&amp;amp;X..A.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But since you are using double &amp;amp;&amp;amp; it will mean that SAS will process the macro reference twice.&amp;nbsp; So it will "eat" two of the dots. And that means that you no longer have the constant dot that is required to generate a two level table name.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Test it using some simple values and the %PUT statement. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;53&amp;nbsp;&amp;nbsp; %let db=MYSCHEMA;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;54&amp;nbsp;&amp;nbsp; %let db1=MYSCHEMA;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;55&amp;nbsp;&amp;nbsp; %let i=1;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;56&amp;nbsp;&amp;nbsp; %put &amp;amp;DB.. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MYSCHEMA.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;57&amp;nbsp;&amp;nbsp; %put &amp;amp;Db&amp;amp;I.. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MYSCHEMA1.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;58&amp;nbsp;&amp;nbsp; %put &amp;amp;&amp;amp;DB&amp;amp;I.. ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MYSCHEMA&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;59&amp;nbsp;&amp;nbsp; %put &amp;amp;&amp;amp;DB&amp;amp;I... ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;MYSCHEMA.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or turn on symbolgen option and see what the macro processor is doing (and clutter up your log so you can't tell what actual SAS is doing).&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 16:48:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160125#M31139</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-25T16:48:57Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160126#M31140</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the quick response Tom.&amp;nbsp; I'm familiar with how the macro processor handles delimiters and that's why I don't understand the behavior I'm seeing. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When used with a single ampersand macro variable two dots resolve as a single dot.&amp;nbsp;&amp;nbsp; But the attachment shows that when used with a double-ampersand macro variable two dots resolve to a blank and three dots resolve to blank-dot.&amp;nbsp; I'm wondering why.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 17:03:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160126#M31140</guid>
      <dc:creator>bentleyj1</dc:creator>
      <dc:date>2014-09-25T17:03:19Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160127#M31141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sounds like you are getting snagged by some parsing issue. &lt;/P&gt;&lt;P&gt;You could try %UNQUOTE() around the reference.&lt;/P&gt;&lt;P&gt;Normally I avoid these type of "macro array" solutions, but when I use them generate the expanded value into a new macro variable. I find it much easier to read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%if &amp;amp;_nUniqTables &amp;gt;= 1 %then %do _n=1 %to &amp;amp;_nUniqTables;&lt;/P&gt;&lt;P&gt;&amp;nbsp; %let table= &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and base.clnt_num=&amp;amp;table..clnt_nr&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; and trim(base.loan_num)=&amp;amp;table..ln_nr&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 17:24:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160127#M31141</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-25T17:24:21Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160128#M31142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might have to rethink your concept of delimiters.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;&amp;amp; resolves into &amp;amp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But two dots resolve into two dots.&amp;nbsp; Always.&amp;nbsp; The confusion arises when it looks like you have two dots, but one of them is text and one of them is a delimiter.&amp;nbsp; Take a piece of your troublesome code:&lt;/P&gt;&lt;P&gt;&amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n.clnt_nr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Macro language treats this as 4 pieces of text:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;&amp;amp; _uniqDbTable &amp;amp;_n. clnt_nr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It resolves each, coming up with:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;_uniqueDbTable1clnt_nr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is probably not what you are hoping for.&amp;nbsp; If you wanted it to resolve to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;_uniqueDbTable1.clnt_nr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then Tom's solution is 100% correct ... just add another dot:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n..clnt_nr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now the pieces of text are:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;&amp;amp; _uniqDbTable &amp;amp;_n. .clnt_nr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The first dot is a delimiter, delimiting that the name of the macro variable is _n.&amp;nbsp; So this resolves to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;amp;_uniqDbTable1.clnt_nr&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The second dot remained as text, but now becomes a delimiter for the name of the macro variable _uniqDbTable1. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are a number of possible variations for what you might be hoping for.&amp;nbsp; Perhaps a third dot would be required here.&amp;nbsp; But clarifying how dots/delimiters work is the key issue.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 17:34:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160128#M31142</guid>
      <dc:creator>test_user_name</dc:creator>
      <dc:date>2014-09-25T17:34:09Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160129#M31143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the detailed reply.&amp;nbsp; The attachment shows the results when using 1 to 4 dots as delimiters between the macro variable holding the table name and the actual field name.&amp;nbsp; When I say I use two dots as delimiters I recognize that the first serves a delimiter marking the end of the macro variable name and the second separates the (resolved) database table name from the field name. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My question is why are 3 dot delimiters required when working with a double-ampersand macro variable holding the table name?&amp;nbsp; Why do the first 2 of the 3 resolve into a space?&amp;nbsp; We see also this behavior when 4 dots are used.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In my code when &amp;amp;_n=1 then &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n resolves to &amp;amp;_uniqDbTable1 and that resolves to V_HM_CE_CUST_ATTR.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The attachement shows the following--&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Number of dot delimiters&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Usage&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Resolution&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 1&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n.clnt_nr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;_uniqDbTable1clnt_nr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error, invalid character&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n..clnt_nr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; V_HM_CE_CUST_ATTR clnt_nr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Error, SQL not properly ended&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 3&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n...clnt_nr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; V_HM_CE_CUST_ATTR .clnt_nr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; no error, SQL runs OK&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 4&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n....clnt_nr&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; V_HM_CE_CUST_ATTR ..clnt_nr&amp;nbsp;&amp;nbsp;&amp;nbsp; Error, invalid table.column&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt; font-family: Courier New;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 18:14:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160129#M31143</guid>
      <dc:creator>bentleyj1</dc:creator>
      <dc:date>2014-09-25T18:14:18Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160130#M31144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not that they are resolving to have an extra space. It is that the notation is confusing the macro processor and it is treating the .TABLENAME as a separate token EVEN THOUGH THERE IS NO SPACE.&amp;nbsp; If you try the same code outside of a macro (do it for a single value of the loop iteration variable) the generated code will work.&amp;nbsp; But of course to iterate over the list of macro variables you have to be in a macro.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 18:38:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160130#M31144</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-25T18:38:05Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160131#M31145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I made a small macro that should have the same logic.&lt;/P&gt;&lt;P&gt;Running that with the 3 dots as should be it give a nice expansion without that space.&lt;/P&gt;&lt;P&gt;All messages are not clear whether this is as space in the marcro variable being resolved or not. It is space on a space.&lt;/P&gt;&lt;P&gt;You could try to trim trailing spaces &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#n1h2vflmc2mnyzn1gwg6dkndpzjb.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#n1h2vflmc2mnyzn1gwg6dkndpzjb.htm"&gt;SAS(R) 9.4 Macro Language: Reference, Second Edition&lt;/A&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;When there is a space in that macrovar (the second expansion) the follow question would be how did that happen?&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options mprint symbolgen mlogic source2 ;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro ntstr () ;&lt;/P&gt;&lt;P&gt; %let tab1=oraloan ;&lt;/P&gt;&lt;P&gt; %let tab2=orabent ;&lt;/P&gt;&lt;P&gt; %do _n=1 %to 2 ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; %put ... and trim(base.loan_num)=&amp;amp;&amp;amp;tab&amp;amp;_n...lnr&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt; %end; &lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; %ntstr() ;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 25 Sep 2014 18:44:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160131#M31145</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-25T18:44:37Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160132#M31146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;1 When the macro has four dots, the order of resolution is:&lt;/P&gt;&lt;P&gt;2 &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n....clnt_nr&lt;/P&gt;&lt;P&gt;3 &amp;amp;_uniqDbTable1...clnt_nr (break down: two &amp;amp;&amp;amp; to one &amp;amp; and 4 dots to 3 dots)&lt;/P&gt;&lt;P&gt;4 V_HM_CE_CUST_ATTR ..clnt_nr (break down: one &amp;amp; is dropped and 1 dot is dropped) - so result is two dots&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;5 When the macro has 3 dots, the order of resolution is:&lt;/P&gt;&lt;P&gt;6 &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n...clnt_nr&lt;/P&gt;&lt;P&gt;7 &amp;amp;_uniqDbTable1..clnt_nr (break down: two &amp;amp;&amp;amp; to one &amp;amp; and 3 dots to 2 dots)&lt;/P&gt;&lt;P&gt;8 V_HM_CE_CUST_ATTR.clnt_nr (one &amp;amp; is dropped) -&amp;nbsp; so result is one dot&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Note: numbers on 1st position on each line designates line number.&lt;/P&gt;&lt;P&gt;Observe that in line 3 when 3 dots are present, there is only one &amp;amp;, but, in line 6 when 3 dots are present, there are two &amp;amp;.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope, that makes sense.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 27 Sep 2014 06:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160132#M31146</guid>
      <dc:creator>nravi</dc:creator>
      <dc:date>2014-09-27T06:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160133#M31147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes, your explanation makes sense nravi.&amp;nbsp; But it doesn't explain why my log shows that two dots resolved to a blank and three dots resolved to blank-dot.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;It happens each time I run the code.&amp;nbsp; The macro value containing the table name does not contain a trailing space.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 14:57:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160133#M31147</guid>
      <dc:creator>bentleyj1</dc:creator>
      <dc:date>2014-09-29T14:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160134#M31148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John and why is my testcode not generating those blanks as your code is. What is different?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 15:00:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160134#M31148</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-29T15:00:05Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160135#M31149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you sure it doesn't contain a trailing space? It could be the only explanation (that I can think of).&lt;/P&gt;&lt;P&gt;Put this line into your code:&lt;/P&gt;&lt;P&gt;%put XXX&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;amp;_uniqDbTable1.XXX;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;Is there a blank?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 15:09:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160135#M31149</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2014-09-29T15:09:33Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160136#M31150</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It is not resolving to include a blank. If you try it outside of a macro you will see that it works fine.&amp;nbsp; Instead the syntax is confusing the macro processor and it is treating the result as two separate tokens, even though there is really no spaces between them.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That is why wrapping the expansion inside of %unquote() solves the problem.&amp;nbsp; This makes the token parser realize that it needs to wait until the %UNQUOTE() was executed before it can determine the number and boundaries of the tokens being generated inside the %unquote() function.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 15:16:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160136#M31150</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-29T15:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160137#M31151</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Tom,&lt;/P&gt;&lt;P&gt;I still believe, that there is a trailing blank in the macro variable.&lt;/P&gt;&lt;P&gt;Your code at &lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #ffffff;"&gt;Sep 25, 2014 1:24 PM is working, because the %let statement removes trailing blanks.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; line-height: 1.5em; background-color: #ffffff;"&gt;%unquote() has similar powers. In this example %unquote removes trailin blanks:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%macro x();&lt;/P&gt;&lt;P&gt;proc sql noprint; select 'class ' into :tab1 from sashelp.class;quit;&lt;/P&gt;&lt;P&gt;%do i=1 %to 1;&lt;/P&gt;&lt;P&gt;%put %unquote(&amp;amp;&amp;amp;tab&amp;amp;i..).age;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;%mend;&lt;/P&gt;&lt;P&gt;%x();&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12px; background-color: #ffffff;"&gt;I also ran Jaap's test. No blanks are added.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;STRONG&gt;&lt;A _jive_internal="true" class="jiveTT-hover-user jive-username-link" data-avatarid="1565" data-externalid="" data-presence="null" data-userid="807594" data-username="bentleyj1" href="https://communities.sas.com/people/bentleyj1" id="jive-80759427384044642394186" style="padding: 0 3px 0 0; font-weight: inherit; font-style: inherit; font-size: 1.1em; font-family: inherit; color: #0e66ba;"&gt;bentleyj1&lt;/A&gt;,&lt;/STRONG&gt;&lt;/SPAN&gt; can you try puting this to the log?&lt;/P&gt;&lt;P&gt;It is "easy" to get trailing spaces into macro variables if you use &lt;STRONG&gt;proc sql into&lt;/STRONG&gt;, or &lt;STRONG&gt;data step&lt;/STRONG&gt; &lt;STRONG&gt;call symput&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Message was edited by: Gergely Bathó&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 15:51:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160137#M31151</guid>
      <dc:creator>gergely_batho</dc:creator>
      <dc:date>2014-09-29T15:51:50Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160138#M31152</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Extra blanks in the value of the macro variables will cause trouble. But I have definitely seen certain combinations where there are not extra spaces and the parser still gets confused. Adding extra code such as %unquote() or changing the code will fix the confusion.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 17:21:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160138#M31152</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-29T17:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160139#M31153</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Very curious.&amp;nbsp; I'd sworn there were no trailing blanks in the macro value and I was wrong.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Earlier in the code I created the macro variable with this code figuring it would remove trailing blanks.&amp;nbsp; The maximum length of tableName is 30 characters and the length of _uniqTable1 was 30 when the trailing blanks are counted.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %** Get the unique table names.&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; select unique strip(tableName) label='Unique Table Name'&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; into : _uniqDbTable1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %if &amp;amp;_nUniqTables &amp;gt; 1 %then -&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; : _uniqDbTable&amp;amp;_nUniqTables ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from&amp;nbsp; &amp;amp;project_name._cell_ltr_tables;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So why does %let _table= &amp;amp;&amp;amp;_uniqDbTable&amp;amp;_n remove trailing blanks but the Proc SQL syntax didn't?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If this is a feature of Proc SQL then I'm going to have to be more careful going forward because I use it a lot to create macro variables.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks to all who contributed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;John&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 19:04:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160139#M31153</guid>
      <dc:creator>bentleyj1</dc:creator>
      <dc:date>2014-09-29T19:04:05Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160140#M31154</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;%LET removes the spaces because spaces are interpreted as token delimiters.&amp;nbsp; So %let X=&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; xxxx&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ; is the same as %let X=xxxx;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You do not need that macro logic.&amp;nbsp; You can let PROC SQL take care of knowing how many macro variables to make. If you have a newer version of SAS then just do not put anything after the hyphen.&amp;nbsp; If you have an older version then just use some obviously too large value for the upper bound.&amp;nbsp; SAS will only create the number of macro variables that it needs.&amp;nbsp; It will also count the number of values for you.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;%&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: green; background: white;"&gt;** Get the unique table names.&amp;nbsp;&amp;nbsp; ;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;select&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; unique tableName&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;into&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; :_uniqDbTable1 - :_uniqDbTable9999&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&amp;nbsp; &lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;from&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; &amp;amp;project_name._cell_ltr_tables&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt;;&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="margin-bottom: .0001pt;"&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: blue; background: white;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="font-size: 10.0pt; font-family: 'Courier New'; color: black; background: white;"&gt; _nUniqTables = &amp;amp;sqlobs ;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 19:13:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160140#M31154</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2014-09-29T19:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Strange behavior when double-ampersand macro variable needs a multiple dot delimiter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160141#M31155</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;John there is a difference in macro language parsing and sas language parsing.&amp;nbsp; Gergely Bathó already mentioned that.&lt;BR /&gt;With the datastep and proc sql you can put literally every kind of character into a macro variable&lt;/P&gt;&lt;P&gt;&lt;A href="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/viewer.htm#p0xlnvl46zgqffn17piej7tewe7p.htm" title="http://support.sas.com/documentation/cdl/en/sqlproc/65065/HTML/default/viewer.htm#p0xlnvl46zgqffn17piej7tewe7p.htm"&gt;SAS(R) 9.4 SQL Procedure User's Guide&lt;/A&gt; (using macro vars) the trim is explicitly activated with concatenating the content. As it mentioned is not by default.&lt;/P&gt;&lt;P&gt;for the datastep there is new function &lt;A href="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#n1nexcs36ctqk5n11uao7k9myz7y.htm" title="http://support.sas.com/documentation/cdl/en/lefunctionsref/67398/HTML/default/viewer.htm#n1nexcs36ctqk5n11uao7k9myz7y.htm"&gt;SAS(R) 9.4 Functions and CALL Routines: Reference, Third Edition&lt;/A&gt; (symputx) is trims space and let you control wich symboltable you are using. Be carefull on that one too as local tables can or may not be nested.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The macro quoting (&lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p1780jrqrtwtw7n16x83peo2zpxr.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p1780jrqrtwtw7n16x83peo2zpxr.htm"&gt;SAS(R) 9.4 Macro Language: Reference, Second Edition&lt;/A&gt; - &lt;A href="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p1k3cotqhvgwk0n105gyfe1cqg9m.htm" title="http://support.sas.com/documentation/cdl/en/mcrolref/67377/HTML/default/viewer.htm#p1k3cotqhvgwk0n105gyfe1cqg9m.htm"&gt;SAS(R) 9.4 Macro Language: Reference, Second Edition&lt;/A&gt; (%quote an %unquote) are to be used when you are defining character in a macro-variable that can conflict with the macro-language. Very predictable and constant in behavior.&lt;/P&gt;&lt;P&gt;As rule of thumb: when possible conflicting chars can occur use %nrquote at the moment of defining and %unquote when using.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 29 Sep 2014 19:29:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Strange-behavior-when-double-ampersand-macro-variable-needs-a/m-p/160141#M31155</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-09-29T19:29:57Z</dc:date>
    </item>
  </channel>
</rss>

