<?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: How to parse string with single quote in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-parse-string-with-single-quote/m-p/184734#M35061</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That did it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much.&amp;nbsp; Still have a lot to learn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 26 Feb 2015 21:49:43 GMT</pubDate>
    <dc:creator>dtchoi86</dc:creator>
    <dc:date>2015-02-26T21:49:43Z</dc:date>
    <item>
      <title>How to parse string with single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-parse-string-with-single-quote/m-p/184732#M35059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;data final;&lt;/P&gt;&lt;P&gt;set raw;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; dm = ':,;';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; mod = 'oq';&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; nwords = countw(raw, dm, mod);&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; do count = 1 to nwords;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clean = strip(scan(raw, count, dm, mod));&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; end;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code above works until it hits a portion of the string that has an apostrophe/single quote.&amp;nbsp; From thereon, it stops parsing.&amp;nbsp; Would I have to code this in a macro environment using %qscan to get around this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any examples?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 21:25:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-parse-string-with-single-quote/m-p/184732#M35059</guid>
      <dc:creator>dtchoi86</dc:creator>
      <dc:date>2015-02-26T21:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse string with single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-parse-string-with-single-quote/m-p/184733#M35060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Do you need to parse strings where delimiters are to be ignored when within quotes?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If not, drop the q modifier: &lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 13.4399995803833px; background-color: #ffffff;"&gt;q: ignores delimiters that are inside of substrings that are enclosed in quotation marks. If the value of the &lt;/SPAN&gt;&lt;SPAN class="strongEmph" style="font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-weight: bold; font-style: italic; color: #000000; font-size: 13.4399995803833px; background-color: #ffffff;"&gt;string&lt;/SPAN&gt;&lt;SPAN style="color: #000000; font-family: arial, 'Arial Unicode MS', geneva, 'Lucida Grande', sans-serif; font-size: 13.4399995803833px; background-color: #ffffff;"&gt; argument contains unmatched quotation marks, then scanning from left to right will produce different words than scanning from right to left.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 21:41:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-parse-string-with-single-quote/m-p/184733#M35060</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2015-02-26T21:41:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to parse string with single quote</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-parse-string-with-single-quote/m-p/184734#M35061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That did it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much.&amp;nbsp; Still have a lot to learn.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Feb 2015 21:49:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-parse-string-with-single-quote/m-p/184734#M35061</guid>
      <dc:creator>dtchoi86</dc:creator>
      <dc:date>2015-02-26T21:49:43Z</dc:date>
    </item>
  </channel>
</rss>

