<?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: The Proper function in ODS and Base Reporting</title>
    <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/286#M104</link>
    <description>Thanks snk1!</description>
    <pubDate>Thu, 30 Mar 2006 09:14:35 GMT</pubDate>
    <dc:creator>deleted_user</dc:creator>
    <dc:date>2006-03-30T09:14:35Z</dc:date>
    <item>
      <title>The Proper function</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/281#M99</link>
      <description>In Excel there is a proper function, quote from their help: &lt;BR /&gt;
&lt;BR /&gt;
"Capitalizes the first letter in a text string and any other letters in text that follow any character other than a letter. Converts all other letters to lowercase letters."&lt;BR /&gt;
&lt;BR /&gt;
There is no equivalent SAS function (I think), but is there is easier way than this?&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  label='I nEED tO_BE/mAdE PRopeR!';&lt;BR /&gt;
  label=lowcase(label);&lt;BR /&gt;
  z=1;&lt;BR /&gt;
  do i=1 to length(label);&lt;BR /&gt;
    if 97 le rank(substr(label,i,1)) le 122 then y=0;&lt;BR /&gt;
                                             else y=1;&lt;BR /&gt;
    if z=1 then substr(label,i,1)=upcase(substr (label,i,1));&lt;BR /&gt;
    z=y*1;&lt;BR /&gt;
  end;&lt;BR /&gt;
  put label=;&lt;BR /&gt;
  run;</description>
      <pubDate>Mon, 27 Mar 2006 13:47:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/281#M99</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-03-27T13:47:02Z</dc:date>
    </item>
    <item>
      <title>Re: The Proper function</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/282#M100</link>
      <description>Here is the code that will convert first letter of string to upcase.&lt;BR /&gt;
&lt;BR /&gt;
/**Macro to convert 1st letter to uppercase**/&lt;BR /&gt;
 %macro UpfirstLetter(Invar);&lt;BR /&gt;
   &amp;amp;Invar.=compbl(lowcase(&amp;amp;Invar.));&lt;BR /&gt;
   length next $ 50;&lt;BR /&gt;
   i=0;&lt;BR /&gt;
   do until(next=' ');&lt;BR /&gt;
    i+1;&lt;BR /&gt;
    next=scan(&amp;amp;Invar.,i," ' '- , . / : ");&lt;BR /&gt;
    pos=index(&amp;amp;Invar.,trim(next));&lt;BR /&gt;
    substr(&amp;amp;Invar.,pos,1)=upcase(substr(&amp;amp;Invar.,pos,1));&lt;BR /&gt;
   end;&lt;BR /&gt;
 %mend UpFirstLetter;&lt;BR /&gt;
 *%UpFirstLetter(name);</description>
      <pubDate>Wed, 29 Mar 2006 13:45:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/282#M100</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-03-29T13:45:08Z</dc:date>
    </item>
    <item>
      <title>Re: The Proper function</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/283#M101</link>
      <description>You need to use the propcase function.  Syntax: &lt;BR /&gt;
propcase(var)&lt;BR /&gt;
&lt;BR /&gt;
This will do what you are trying to do.</description>
      <pubDate>Wed, 29 Mar 2006 14:14:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/283#M101</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-03-29T14:14:50Z</dc:date>
    </item>
    <item>
      <title>Re: The Proper function</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/284#M102</link>
      <description>Quote Q:&lt;BR /&gt;
"You need to use the propcase function. Syntax: &lt;BR /&gt;
propcase(var)&lt;BR /&gt;
&lt;BR /&gt;
This will do what you are trying to do. "&lt;BR /&gt;
&lt;BR /&gt;
I am using version 8.2 and there is no such function. Is this a new function in version 9?</description>
      <pubDate>Wed, 29 Mar 2006 14:26:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/284#M102</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-03-29T14:26:30Z</dc:date>
    </item>
    <item>
      <title>Re: The Proper function</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/285#M103</link>
      <description>Propcase() is new in SAS 9. Try the code I posted, should give you what you are looking for.</description>
      <pubDate>Wed, 29 Mar 2006 16:34:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/285#M103</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-03-29T16:34:47Z</dc:date>
    </item>
    <item>
      <title>Re: The Proper function</title>
      <link>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/286#M104</link>
      <description>Thanks snk1!</description>
      <pubDate>Thu, 30 Mar 2006 09:14:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/ODS-and-Base-Reporting/The-Proper-function/m-p/286#M104</guid>
      <dc:creator>deleted_user</dc:creator>
      <dc:date>2006-03-30T09:14:35Z</dc:date>
    </item>
  </channel>
</rss>

