<?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: Apparent symbolic reference not resolved in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302793#M64272</link>
    <description>&lt;P&gt;Thank you both. That was very clear and helpful.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Oct 2016 20:42:46 GMT</pubDate>
    <dc:creator>apolitical</dc:creator>
    <dc:date>2016-10-05T20:42:46Z</dc:date>
    <item>
      <title>Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302775#M64264</link>
      <description>&lt;P&gt;For the following statemen in a data proc:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;if company_name = "johnson &amp;amp; johnson" &amp;nbsp;then company_standardized = "Johnson &amp;amp; Johnson Co.";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's clear what I want to do. The log says "Apparent symbolic reference not resolved", presumably looking for a macro definition when it sees the &amp;amp; sign. My question is, has SAS correct done what I want it to do? If not, how do I force SAS to see &amp;amp; as just a symbol in the string, rather than macro? Thanks.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 19:57:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302775#M64264</guid>
      <dc:creator>apolitical</dc:creator>
      <dc:date>2016-10-05T19:57:38Z</dc:date>
    </item>
    <item>
      <title>Re: Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302777#M64265</link>
      <description>&lt;P&gt;You can clear up the problem by using single quotes instead of double quotes.&amp;nbsp; Single quotes suppress all macro activity.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But this particular example wouldn't cause the problem.&amp;nbsp; There would have to be a letter (not a space) immediately following the ampersand.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 20:01:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302777#M64265</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-05T20:01:08Z</dc:date>
    </item>
    <item>
      <title>Re: Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302779#M64267</link>
      <description>So the way to fix it is to substitute the double quotes with single quotes in that line. And what would happen if the statement is&lt;BR /&gt;if company_name = "johnson&amp;amp;johnson" then company_standardized = "Johnson &amp;amp; Johnson Co.";&lt;BR /&gt;</description>
      <pubDate>Wed, 05 Oct 2016 20:09:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302779#M64267</guid>
      <dc:creator>apolitical</dc:creator>
      <dc:date>2016-10-05T20:09:09Z</dc:date>
    </item>
    <item>
      <title>Re: Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302783#M64269</link>
      <description>&lt;P&gt;That would give you the message you received, because of the IF condition where there are letters following the &amp;amp;.&amp;nbsp; But if you switch to single quotes, all will be well.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 20:13:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302783#M64269</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2016-10-05T20:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302786#M64270</link>
      <description>&lt;P&gt;You'll get a warning, but it doesn't impact your analysis...unless you happen to have a macro variable with the same name it's looking for.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This won't cause any issues.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if company_name = 'johnson&amp;amp;johnson' then company_standardized = 'Johnson &amp;amp; Johnson Co.';&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;This could happen...&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%let johnson=WRONG_ANSWER;

data test;
length company_standardized_wrong company_standardized_correct $100.;
company_name = 'johnson&amp;amp;johnson';

if company_name = "johnson&amp;amp;johnson" then company_standardized_wrong = "Johnson &amp;amp; Johnson Co.";
else company_standardized_wrong="johnson&amp;amp;johnson";

if company_name = 'johnson&amp;amp;johnson' then company_standardized_correct = "Johnson &amp;amp; Johnson Co.";
else company_standardized_correct='WRONG';
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 05 Oct 2016 20:28:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302786#M64270</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2016-10-05T20:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Apparent symbolic reference not resolved</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302793#M64272</link>
      <description>&lt;P&gt;Thank you both. That was very clear and helpful.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2016 20:42:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Apparent-symbolic-reference-not-resolved/m-p/302793#M64272</guid>
      <dc:creator>apolitical</dc:creator>
      <dc:date>2016-10-05T20:42:46Z</dc:date>
    </item>
  </channel>
</rss>

