<?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 put both single quotes (') and double quote (&amp;quot;) into the same PRXCHANGE function? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-both-single-quotes-and-double-quote-quot-into-the/m-p/595138#M171161</link>
    <description>&lt;P&gt;You don't need to do anything special to include a character that is different those used to enclose the string. So to express DON'T enclosed in double quotes you just need to type:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"DON'T"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to include the character used to enclose the string then just double it.&amp;nbsp; So to express DON'T enclosed in single quotes you need to type:&lt;/P&gt;
&lt;PRE&gt;'DON''T'&lt;/PRE&gt;
&lt;P&gt;So to make a string that has both types of quotes one will be doubled and the other not, depending on what the outer characters are.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'"DON''T"'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 09 Oct 2019 17:25:31 GMT</pubDate>
    <dc:creator>Tom</dc:creator>
    <dc:date>2019-10-09T17:25:31Z</dc:date>
    <item>
      <title>How to put both single quotes (') and double quote (") into the same PRXCHANGE function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-both-single-quotes-and-double-quote-quot-into-the/m-p/595137#M171160</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to put both single quotes (') and double quote (") into the same PRXCHANGE function?&lt;/P&gt;&lt;P&gt;I would like to change the company suffix '&lt;CODE class=" language-sas"&gt;LTD LIABILITY CO' to 'LLC' if it is not partioned by the following puncations which are &lt;U&gt;() [] {} ' "&lt;/U&gt;&amp;nbsp; However, it seems that I cannot put the single and double quotes in the same PRXCHANGE function. Could you please give me some suggestion about this?&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input string :$200.;
infile datalines ;
name_S25=prxchange('s/([^\w^\d])LTD[^\w^\d^\{^\}^\[^\]^\(^\)^\'^\"]+LIABILITY[^\w^\d^\{^\}^\[^\]^\(^\)^\'^\"]+CO([^\w^\d])/$1 LLC $2/',-1,cat(strip(compbl(name)),' '));
datalines;
APPLE LTD., LIABILITY CO
'APPLE LTD' LIABILITY CO
"APPLE LTD" LIABILITY CO
APPLE LTD (LIABILITY CO)&lt;BR /&gt;APPLE LTD [LIABILITY CO]&lt;BR /&gt;{APPLE LTD} LIABILITY CO
;
run;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I expect to get&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;name&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;new_name&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APPLE LTD., LIABILITY CO&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;APPLE LLC&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;changed&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;'APPLE LTD' LIABILITY CO&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;'APPLE LTD' LIABILITY CO&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;no change&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APPLE LTD LIABILITY CO&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;APPLE LTD LIABILITY CO&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;no change&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APPLE LTD (LIABILITY CO)&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;APPLE LTD (LIABILITY CO)&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;no change&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;APPLE LTD [LIABILITY CO]&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;APPLE LTD [LIABILITY CO]&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;no change&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Wed, 09 Oct 2019 17:17:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-both-single-quotes-and-double-quote-quot-into-the/m-p/595137#M171160</guid>
      <dc:creator>Alexxxxxxx</dc:creator>
      <dc:date>2019-10-09T17:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to put both single quotes (') and double quote (") into the same PRXCHANGE function?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-put-both-single-quotes-and-double-quote-quot-into-the/m-p/595138#M171161</link>
      <description>&lt;P&gt;You don't need to do anything special to include a character that is different those used to enclose the string. So to express DON'T enclosed in double quotes you just need to type:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;"DON'T"&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;If you want to include the character used to enclose the string then just double it.&amp;nbsp; So to express DON'T enclosed in single quotes you need to type:&lt;/P&gt;
&lt;PRE&gt;'DON''T'&lt;/PRE&gt;
&lt;P&gt;So to make a string that has both types of quotes one will be doubled and the other not, depending on what the outer characters are.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;'"DON''T"'&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Oct 2019 17:25:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-put-both-single-quotes-and-double-quote-quot-into-the/m-p/595138#M171161</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-10-09T17:25:31Z</dc:date>
    </item>
  </channel>
</rss>

