<?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: Problem reading string with a single quote in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Problem-reading-string-with-a-single-quote/m-p/91244#M19293</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can always get tricky characters into macro variables,.&amp;nbsp; As you have found out, utilizing them later may be difficult.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to display them, you can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put %superq(vara);&lt;/P&gt;&lt;P&gt;%put %superq(varb);&lt;/P&gt;&lt;P&gt;%put %superq(varc);&lt;/P&gt;&lt;P&gt;%put %superq(vard);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, macro quoting functions such as %SUPERQ can temporarily mask the tricky characters.&amp;nbsp; Depending on how you want to use these values, you might need different quoting functions at various points within your code.&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>Fri, 31 May 2013 15:16:43 GMT</pubDate>
    <dc:creator>Astounding</dc:creator>
    <dc:date>2013-05-31T15:16:43Z</dc:date>
    <item>
      <title>Problem reading string with a single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-reading-string-with-a-single-quote/m-p/91243#M19292</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;Hi,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm trying to set a variable reading from a dataset some clumns value that should contains strange char as a single quote (') or &amp;amp;.&lt;/P&gt;&lt;P&gt;example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data inputds;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; aaa = "aaa'aaa";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; bbb = 'bbb';&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ccc = "ccc'ccc'ccc";&lt;BR /&gt;&amp;nbsp;&amp;nbsp; ddd = 'dd&amp;amp;dd';&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;proc sql noprint;&lt;BR /&gt;&amp;nbsp; select aaa, bbb, ccc, ddd into :vara, :varb, :varc, :vard from inputds;&lt;BR /&gt;quit;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I run&lt;BR /&gt;%put &amp;amp;vara;&lt;BR /&gt;%put &amp;amp;varb;&lt;BR /&gt;%put &amp;amp;varc;&lt;BR /&gt;%put &amp;amp;vard;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Sas does not work. Do there is a way to populate some variables in a safety way independently by what is is contains?&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;P&gt;Antonio&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 31 May 2013 14:58:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-reading-string-with-a-single-quote/m-p/91243#M19292</guid>
      <dc:creator>garag</dc:creator>
      <dc:date>2013-05-31T14:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: Problem reading string with a single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Problem-reading-string-with-a-single-quote/m-p/91244#M19293</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can always get tricky characters into macro variables,.&amp;nbsp; As you have found out, utilizing them later may be difficult.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Just to display them, you can use:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put %superq(vara);&lt;/P&gt;&lt;P&gt;%put %superq(varb);&lt;/P&gt;&lt;P&gt;%put %superq(varc);&lt;/P&gt;&lt;P&gt;%put %superq(vard);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In general, macro quoting functions such as %SUPERQ can temporarily mask the tricky characters.&amp;nbsp; Depending on how you want to use these values, you might need different quoting functions at various points within your code.&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>Fri, 31 May 2013 15:16:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Problem-reading-string-with-a-single-quote/m-p/91244#M19293</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2013-05-31T15:16:43Z</dc:date>
    </item>
  </channel>
</rss>

