<?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: Literal variable name treatment in Proc SQL in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224860#M5375</link>
    <description>&lt;P&gt;How about %NRSTR:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let test = %NRSTR(A&amp;amp;B);
%put test = &amp;amp;test;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 09 Sep 2015 22:19:10 GMT</pubDate>
    <dc:creator>SASKiwi</dc:creator>
    <dc:date>2015-09-09T22:19:10Z</dc:date>
    <item>
      <title>Literal variable name treatment in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224854#M5372</link>
      <description>&lt;P&gt;I am trying to load a dataset from the microsoft SQL server into SAS using Proc SQL (as shown below)&lt;/P&gt;
&lt;P&gt;One of the variable name contains the "&amp;amp;" character, which SAS interpreted as a macro variable reference, giving out a warning message '&lt;FONT color="#FF00FF"&gt;WARNING: Apparent symbolic reference B not resolved.&lt;/FONT&gt;'&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am wondering what would be the proper way to reference this variable. Apparently quoting the variable name as literal 'A&amp;amp;B Variable'n does not work in the Proc SQL setting as I've tried it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;proc sql;
	connect to sqlsvr(dsn=XXXX user=AAAA password=****);
	create table New as
	select * from connection to sqlsvr
	(
	Select 
	Base.[ID] as ID,
	Base.[A&lt;FONT color="#FF0000"&gt;&amp;amp;B&lt;/FONT&gt; Variable] as AB_Var
	from InputDateSet as Base        
	);
quit;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks in advance for your help.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 21:20:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224854#M5372</guid>
      <dc:creator>JerryW</dc:creator>
      <dc:date>2015-09-09T21:20:28Z</dc:date>
    </item>
    <item>
      <title>Re: Literal variable name treatment in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224855#M5373</link>
      <description>&lt;P&gt;Did you try &lt;SPAN class="strong"&gt;%NRQUOTE. It works for macros. no harm trying it.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 21:29:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224855#M5373</guid>
      <dc:creator>stevyfargose</dc:creator>
      <dc:date>2015-09-09T21:29:20Z</dc:date>
    </item>
    <item>
      <title>Re: Literal variable name treatment in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224856#M5374</link>
      <description>&lt;P&gt;Tried that too: &lt;STRONG&gt;Base.[%nrquote(A&amp;amp;B Variable)]&lt;/STRONG&gt;. Same warning msg pops up. &amp;nbsp;&lt;img id="mansad" class="emoticon emoticon-mansad" src="https://communities.sas.com/i/smilies/16x16_man-sad.png" alt="Man Sad" title="Man Sad" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 21:34:41 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224856#M5374</guid>
      <dc:creator>JerryW</dc:creator>
      <dc:date>2015-09-09T21:34:41Z</dc:date>
    </item>
    <item>
      <title>Re: Literal variable name treatment in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224860#M5375</link>
      <description>&lt;P&gt;How about %NRSTR:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let test = %NRSTR(A&amp;amp;B);
%put test = &amp;amp;test;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 09 Sep 2015 22:19:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224860#M5375</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2015-09-09T22:19:10Z</dc:date>
    </item>
    <item>
      <title>Re: Literal variable name treatment in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224861#M5376</link>
      <description>&lt;P&gt;try OPTIONS VALIDVARNAME=V7; and then import&lt;/P&gt;</description>
      <pubDate>Wed, 09 Sep 2015 22:20:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224861#M5376</guid>
      <dc:creator>stevyfargose</dc:creator>
      <dc:date>2015-09-09T22:20:21Z</dc:date>
    </item>
    <item>
      <title>Re: Literal variable name treatment in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224902#M5382</link>
      <description>&lt;P&gt;2 part solution&lt;/P&gt;&lt;P&gt;part 1: rename all similarly named columns in the database with names that will work over all environments (only use characters a-z, 0-9, underline)&lt;/P&gt;&lt;P&gt;part 2: shoot the one who had the spectacularly foolish idea to name a database column "A&amp;amp;B Variable"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just kidding about part 2, but part 1 will save you lots of grief in the future.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 05:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224902#M5382</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2015-09-10T05:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: Literal variable name treatment in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224964#M5383</link>
      <description>&lt;P&gt;%NRSTR worked! Thanks very much.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Base.[&lt;STRONG&gt;%NRSTR&lt;/STRONG&gt;(A&amp;amp;B Variable)]&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 14:23:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224964#M5383</guid>
      <dc:creator>JerryW</dc:creator>
      <dc:date>2015-09-10T14:23:25Z</dc:date>
    </item>
    <item>
      <title>Re: Literal variable name treatment in Proc SQL</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224967#M5386</link>
      <description>&lt;P&gt;&lt;SPAN&gt;Unfortunately this is a read-only database to me and I have no control over how the variables are named.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Sep 2015 14:25:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Literal-variable-name-treatment-in-Proc-SQL/m-p/224967#M5386</guid>
      <dc:creator>JerryW</dc:creator>
      <dc:date>2015-09-10T14:25:02Z</dc:date>
    </item>
  </channel>
</rss>

