<?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: Proper Name Case in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proper-Name-Case/m-p/188733#M47741</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The PROPCASE command works on most words, but McFarlane, which has multiple capital letters, will fail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 17 Oct 2014 12:40:01 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2014-10-17T12:40:01Z</dc:date>
    <item>
      <title>Proper Name Case</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proper-Name-Case/m-p/188732#M47740</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;I have a question about name casing. I've done a quick search on the forums but couldn't find anything initially, so I apologise if this question has been asked before, but I was wondering if anyone had any particular method for proper name casing?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;By this I mean, you have all names in say lower case in a dataset containing customer names for example. You need to put together an email or mailing campaign to these customers, however you do not want to offend any of your customers by trying to proper case their surnames, which usually disregards second capitalisation (with surnames like O'Toole or McFarlane)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;With my current knowledge I could easily format names so they look like;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter Mcfarlane&lt;/P&gt;&lt;P&gt;Robert O'toole&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Or;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PETER MCFARLANE&lt;/P&gt;&lt;P&gt;ROBERT O'TOOLE&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;but I was wondering if anyone had an ingenious way of producing the proper case like;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Peter McFarlane&lt;/P&gt;&lt;P&gt;Robert O'Toole&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I mean, is it a case that I'm going to need to set up a custom string of IF statements to check the string for certain characters? (this is what I would do I guess) Or, is there another ingenious and simple way to nail this type of issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;~ Tom&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 12:32:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proper-Name-Case/m-p/188732#M47740</guid>
      <dc:creator>Thoney</dc:creator>
      <dc:date>2014-10-17T12:32:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proper Name Case</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proper-Name-Case/m-p/188733#M47741</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The PROPCASE command works on most words, but McFarlane, which has multiple capital letters, will fail.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 12:40:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proper-Name-Case/m-p/188733#M47741</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2014-10-17T12:40:01Z</dc:date>
    </item>
    <item>
      <title>Re: Proper Name Case</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proper-Name-Case/m-p/188734#M47742</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You don't get that "out-of-the-box" with Base SAS. If you have the Data Quality Server licensed then you could easily get it by using DQ functions for casing &lt;A class="active_link" href="http://support.sas.com/documentation/cdl/en/dqclref/63171/HTML/default/viewer.htm#p0ccmxri1e463hn15g6uxn5dz5cc.htm" title="http://support.sas.com/documentation/cdl/en/dqclref/63171/HTML/default/viewer.htm#p0ccmxri1e463hn15g6uxn5dz5cc.htm"&gt;SAS(R) 9.3 Data Quality Server Reference&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;A compromise could be to use Propcase() and then some additional logic for defined cases as done in below sample code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data sample;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input name_string $40.;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Name_Prop=propcase(name_string);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Name_RegEx=prxchange("s/\bmc([[:alpha:]])/Mc\U\1/oi",-1,Name_Prop);&lt;/P&gt;&lt;P&gt;&amp;nbsp; Name_RegEx=prxchange("s/(?&amp;lt;=\b[[:alpha:]]')([[:alpha:]])/\U\1/oi",-1,Name_RegEx);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; datalines;&lt;/P&gt;&lt;P&gt;peter mcfarlane&lt;/P&gt;&lt;P&gt;claudia schiffer&lt;/P&gt;&lt;P&gt;robert o'toole&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 12:40:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proper-Name-Case/m-p/188734#M47742</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2014-10-17T12:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proper Name Case</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proper-Name-Case/m-p/188735#M47743</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Its not even that consistent unfortunately.&amp;nbsp; If you have names from further afield there is different regional variations etc: &lt;A href="http://en.wikipedia.org/wiki/Capitalization#Sentence_case_versus_title_case"&gt;http://en.wikipedia.org/wiki/Capitalization#Sentence_case_versus_title_case&lt;/A&gt;&lt;/P&gt;&lt;P&gt;My suggestion, find out what is "required" at output and what is actually stored currently and see if there is a compromise to be had, e.g. all upcase or something.&amp;nbsp; You might also want to remove identifiers completely e.g de-identification.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Oct 2014 13:29:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proper-Name-Case/m-p/188735#M47743</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2014-10-17T13:29:04Z</dc:date>
    </item>
  </channel>
</rss>

