<?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: Data step: value with ampersand inside in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Data-step-value-with-ampersand-inside/m-p/97513#M290471</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Garag,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, this would lead to apparent symbolc warning since SAS consider G (ie.,M&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;&amp;amp;G&lt;/STRONG&gt;&lt;/SPAN&gt; Company) as macro variable in the session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in order to avoid this, You should use Macro Masking function such as %str(), %nrstr(),%quote()........etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the below code.&lt;/P&gt;&lt;P&gt;%let mycompany&lt;STRONG&gt;=%nrstr(&lt;/STRONG&gt;M&amp;amp;G CORPORATION&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Portfolio_holding_lt_30;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length MYCOMPANY $ 100&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MYCOMPANY = "&amp;amp;mycompany.";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 06 Jun 2013 11:12:35 GMT</pubDate>
    <dc:creator>suraestar</dc:creator>
    <dc:date>2013-06-06T11:12:35Z</dc:date>
    <item>
      <title>Data step: value with ampersand inside</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-value-with-ampersand-inside/m-p/97512#M290470</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have the followng code:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let mycompany=M&amp;amp;G CORPORATION;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Portfolio_holding_lt_30;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length MYCOMPANY $ 100&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MYCOMPANY = "&amp;amp;mycompany.";&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;%put &amp;amp;syserr;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I get a warning and the syserr is equals to 4. I don't like this because I check if syserr &amp;gt; 0 then If yes I stop the execution.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To there is a workaround to the instruction&lt;/P&gt;&lt;P&gt;MYCOMPANY = "&amp;amp;mycompany.";&lt;/P&gt;&lt;P&gt;in order to avoid to get syserr = 0&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks.&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 11:07:19 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-value-with-ampersand-inside/m-p/97512#M290470</guid>
      <dc:creator>garag</dc:creator>
      <dc:date>2013-06-06T11:07:19Z</dc:date>
    </item>
    <item>
      <title>Re: Data step: value with ampersand inside</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-value-with-ampersand-inside/m-p/97513#M290471</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Garag,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes, this would lead to apparent symbolc warning since SAS consider G (ie.,M&lt;SPAN style="text-decoration: underline;"&gt;&lt;STRONG&gt;&amp;amp;G&lt;/STRONG&gt;&lt;/SPAN&gt; Company) as macro variable in the session.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So in order to avoid this, You should use Macro Masking function such as %str(), %nrstr(),%quote()........etc.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Try the below code.&lt;/P&gt;&lt;P&gt;%let mycompany&lt;STRONG&gt;=%nrstr(&lt;/STRONG&gt;M&amp;amp;G CORPORATION&lt;STRONG&gt;);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data Portfolio_holding_lt_30;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; length MYCOMPANY $ 100&amp;nbsp; ;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MYCOMPANY = "&amp;amp;mycompany.";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 11:12:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-value-with-ampersand-inside/m-p/97513#M290471</guid>
      <dc:creator>suraestar</dc:creator>
      <dc:date>2013-06-06T11:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: Data step: value with ampersand inside</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Data-step-value-with-ampersand-inside/m-p/97514#M290472</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's another way that might be appropriate:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%let mycompany = 'M&amp;amp;G CORPORATION';&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Then later:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MYCOMPANY = &amp;amp;MYCOMPANY;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As long as all uses of the macro variable require quotes around the company name, this would work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Good luck.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 06 Jun 2013 14:46:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Data-step-value-with-ampersand-inside/m-p/97514#M290472</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-06-06T14:46:25Z</dc:date>
    </item>
  </channel>
</rss>

