<?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: Need ampersand to act as the actual value and SAS not think it is a macro in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888437#M351013</link>
    <description>&lt;P&gt;Just use single quotes around the value instead of double quotes and the macro processor will ignore the content of the string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%colorchk(Color,'Black&amp;amp;White' "Purple" "Blue" "Red");&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Tue, 08 Aug 2023 18:04:46 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2023-08-08T18:04:46Z</dc:date>
    <item>
      <title>Need ampersand to act as the actual value and SAS not think it is a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888436#M351012</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm putting together some code to check valid values.&amp;nbsp; If it isn't in the valid values, it would be put into the dataset, tmp.&lt;/P&gt;
&lt;P&gt;However, one of the valid values contains an ampersand.&amp;nbsp; How do I trick SAS so it doesn't think it is a macro.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have simplified the code I actually wrote to the part I'm having issues with&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;DIV&gt;data Test_Data;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; input Person $ Color $20.;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp; &amp;nbsp; datalines;&lt;/DIV&gt;
&lt;DIV&gt;Person1 Black&amp;amp;White&lt;/DIV&gt;
&lt;DIV&gt;Person2 Purple&lt;/DIV&gt;
&lt;DIV&gt;Person3 Black&amp;amp;White&lt;/DIV&gt;
&lt;DIV&gt;Person4 Blue&lt;/DIV&gt;
&lt;DIV&gt;Person5 Red&lt;/DIV&gt;
&lt;DIV&gt;;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;%macro colorchk(var1,var2);&lt;/DIV&gt;
&lt;DIV&gt;data tmp (keep=Person Color);&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; set Test_Data;&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;SPAN&gt; if &amp;amp;var1. ^in (&amp;amp;var2.);&lt;/SPAN&gt;&lt;/DIV&gt;
&lt;DIV&gt;run;&lt;/DIV&gt;
&lt;DIV&gt;%mend colorchk;&lt;/DIV&gt;
&lt;DIV&gt;%colorchk(Color,"Black&amp;amp;White" "Purple" "Blue" "Red");&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;
&lt;DIV&gt;When you run this, you get this in the log:&lt;BR /&gt;WARNING: Apparent symbolic reference WHITE not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference WHITE not resolved.&lt;BR /&gt;&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;Is there a way to code so this warning doesn't happen??&lt;/DIV&gt;
&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Tue, 08 Aug 2023 18:00:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888436#M351012</guid>
      <dc:creator>HN2001</dc:creator>
      <dc:date>2023-08-08T18:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Need ampersand to act as the actual value and SAS not think it is a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888437#M351013</link>
      <description>&lt;P&gt;Just use single quotes around the value instead of double quotes and the macro processor will ignore the content of the string.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;%colorchk(Color,'Black&amp;amp;White' "Purple" "Blue" "Red");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Aug 2023 18:04:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888437#M351013</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-08T18:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Need ampersand to act as the actual value and SAS not think it is a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888456#M351015</link>
      <description>&lt;P&gt;Thanks Tom!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;That does seem to work.&amp;nbsp; A similar question, I also have a pdf with frequencies being produced.&amp;nbsp; in this pdf, I was also outputting the valid values from the macro statement.&lt;/P&gt;
&lt;P&gt;However, the warnings also appear for that too.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is the code I have:&lt;/P&gt;
&lt;P&gt;ods pdf text="^{style [font_face=arial font_weight=Bold font_size=14pt color=blue just=center] &amp;amp;var1.}";&lt;BR /&gt;proc freq data=Test_Data;&lt;BR /&gt;table Group*&amp;amp;var1./list missing;&lt;BR /&gt;run;&lt;BR /&gt;ods pdf text="^{style [font_face=arial font_size=12pt color=blue just=center] &amp;amp;var1. has no out of range observations}";&lt;BR /&gt;ods pdf text="^{style [font_face=arial font_size=12pt color=blue just=center] Possible values: %bquote(&amp;amp;var2.)}";&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;The last line is what also gives the warning:&lt;/P&gt;
&lt;P&gt;WARNING: Apparent symbolic reference WHITE not resolved.&lt;BR /&gt;WARNING: Apparent symbolic reference WHITE not resolved.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Aug 2023 18:43:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888456#M351015</guid>
      <dc:creator>HN2001</dc:creator>
      <dc:date>2023-08-08T18:43:55Z</dc:date>
    </item>
    <item>
      <title>Re: Need ampersand to act as the actual value and SAS not think it is a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888459#M351016</link>
      <description>&lt;P&gt;If you don't want the &amp;amp; evaluated then don't use %BQUOTE().&amp;nbsp; That is one of the main reason TO use %BQUOTE() is to quote values that are enclosed in single quotes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You might use %SUPERQ() instead to add macro quoting.&amp;nbsp; Pass just the NAME of the macro variable whose value you want quoted.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;ods pdf text="^{style [font_face=arial font_size=12pt color=blue just=center] Possible values: %superq(var2)}";&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Aug 2023 19:12:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888459#M351016</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-08-08T19:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Need ampersand to act as the actual value and SAS not think it is a macro</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888566#M351053</link>
      <description>&lt;P&gt;Tom - Thank you so much for your help!&amp;nbsp; It cleaned up the log and still gave me the output I was looking for!&amp;nbsp; Thanks again&lt;/P&gt;</description>
      <pubDate>Wed, 09 Aug 2023 13:45:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Need-ampersand-to-act-as-the-actual-value-and-SAS-not-think-it/m-p/888566#M351053</guid>
      <dc:creator>HN2001</dc:creator>
      <dc:date>2023-08-09T13:45:05Z</dc:date>
    </item>
  </channel>
</rss>

