<?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 write a quote inside a character string? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155545#M298809</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following approach might be more generalizable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have (drop=x y);&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat last_name x y $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile cards dlm='"' truncover;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input last_name x y;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if length(strip(x)) gt 1 then last_name=cat(strip(last_name),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' ',substr(x,1,1),'. ',strip(y));&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;Joe"Average"Smith&lt;/P&gt;&lt;P&gt;Mary Jones&lt;/P&gt;&lt;P&gt;Tom"Tall"Jones&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Mar 2014 14:17:50 GMT</pubDate>
    <dc:creator>art297</dc:creator>
    <dc:date>2014-03-25T14:17:50Z</dc:date>
    <item>
      <title>How to write a quote inside a character string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155543#M298807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What's the syntax for an if-then statement where my 'if' variable is character and the value has quotes in it. For example: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The &lt;EM&gt;client name&lt;/EM&gt; is originally Joe "Average" Smith but I want to change it to Joe A Smith...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;if last_name="Joe"Average"Smith" then last_name="Joe A Smith";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;won't work&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;because 'the meaning of an identifier after a quoted string might change in a future SAS release.&amp;nbsp; Inserting white spaced between a quoted string and the succeeding identifier is recommended.&lt;/P&gt;&lt;P&gt;My quotes are balanced...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 13:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155543#M298807</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2014-03-25T13:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a quote inside a character string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155544#M298808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Either double up the quotes in the centre or alternate single and double&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12.800000190734863px; background-color: #ffffff;"&gt;if last_name="Joe""Average""Smith" then last_name="Joe A Smith";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.800000190734863px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;if last_name='Joe"Average"Smith' then last_name="Joe A Smith";&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.800000190734863px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 12.800000190734863px; background-color: #ffffff; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif;"&gt;Richard&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 14:06:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155544#M298808</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-03-25T14:06:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a quote inside a character string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155545#M298809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The following approach might be more generalizable:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data have (drop=x y);&lt;/P&gt;&lt;P&gt;&amp;nbsp; informat last_name x y $50.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile cards dlm='"' truncover;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input last_name x y;&lt;/P&gt;&lt;P&gt;&amp;nbsp; if length(strip(x)) gt 1 then last_name=cat(strip(last_name),&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' ',substr(x,1,1),'. ',strip(y));&lt;/P&gt;&lt;P&gt;&amp;nbsp; cards;&lt;/P&gt;&lt;P&gt;Joe"Average"Smith&lt;/P&gt;&lt;P&gt;Mary Jones&lt;/P&gt;&lt;P&gt;Tom"Tall"Jones&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 14:17:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155545#M298809</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2014-03-25T14:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a quote inside a character string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155546#M298810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks Richard and Arthur!!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Mar 2014 22:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155546#M298810</guid>
      <dc:creator>Maisha_Huq</dc:creator>
      <dc:date>2014-03-25T22:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to write a quote inside a character string?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155547#M298811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am hoping that the examples you gave are made up for the purpose of understanding quoting, and not representative of real data in one of your databases.&amp;nbsp; If the data is real I believe it would be wrong to create a middle initial based on what appears to be a nickname, and I would hesitate to remove the information inside the quotes entirely.&amp;nbsp; The best solution would be to create a nickname column and move the data in quotes to the new column.&amp;nbsp; I can suggest code if required.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Richard&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 27 Mar 2014 00:53:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-write-a-quote-inside-a-character-string/m-p/155547#M298811</guid>
      <dc:creator>RichardinOz</dc:creator>
      <dc:date>2014-03-27T00:53:40Z</dc:date>
    </item>
  </channel>
</rss>

