<?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 Create a space in a character string where there is a capital letter in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Create-a-space-in-a-character-string-where-there-is-a-capital/m-p/672784#M202236</link>
    <description>&lt;P&gt;I have some data on employment types but it's in a slightly odd format and would love some assistance fixing this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data has no spaces in it, but does (mostly) have a capital letter designating the start of the second or nth work.&amp;nbsp; I would like to create a new variable that takes this employment type and inserts a space where it sees a capital letter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;EG;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Have&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;EmpType&lt;/P&gt;&lt;P&gt;SteelIndustry&lt;/P&gt;&lt;P&gt;ClothingTrade&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Want&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NewEmpType&lt;/P&gt;&lt;P&gt;Steel Industry&lt;/P&gt;&lt;P&gt;Clothing Trade&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One slight stumbling block is that there are some words that have been capitalised that should remain that way and not have spaces inserted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;EG;&amp;nbsp; GovernmentUSA = Government USA.&amp;nbsp; LTDTrader = LTD Trader.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, there are some odd ones in here like Universityprofessor.&amp;nbsp; Now I know what that should be by looking at it, but if anyone has any suggestions as to how to fix scenarios like that i'd be very impressed!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Tue, 28 Jul 2020 11:58:52 GMT</pubDate>
    <dc:creator>Jamie_H</dc:creator>
    <dc:date>2020-07-28T11:58:52Z</dc:date>
    <item>
      <title>Create a space in a character string where there is a capital letter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-space-in-a-character-string-where-there-is-a-capital/m-p/672784#M202236</link>
      <description>&lt;P&gt;I have some data on employment types but it's in a slightly odd format and would love some assistance fixing this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The data has no spaces in it, but does (mostly) have a capital letter designating the start of the second or nth work.&amp;nbsp; I would like to create a new variable that takes this employment type and inserts a space where it sees a capital letter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;EG;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Have&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;EmpType&lt;/P&gt;&lt;P&gt;SteelIndustry&lt;/P&gt;&lt;P&gt;ClothingTrade&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Want&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NewEmpType&lt;/P&gt;&lt;P&gt;Steel Industry&lt;/P&gt;&lt;P&gt;Clothing Trade&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One slight stumbling block is that there are some words that have been capitalised that should remain that way and not have spaces inserted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;EG;&amp;nbsp; GovernmentUSA = Government USA.&amp;nbsp; LTDTrader = LTD Trader.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Finally, there are some odd ones in here like Universityprofessor.&amp;nbsp; Now I know what that should be by looking at it, but if anyone has any suggestions as to how to fix scenarios like that i'd be very impressed!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 11:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-space-in-a-character-string-where-there-is-a-capital/m-p/672784#M202236</guid>
      <dc:creator>Jamie_H</dc:creator>
      <dc:date>2020-07-28T11:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create a space in a character string where there is a capital letter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-space-in-a-character-string-where-there-is-a-capital/m-p/672804#M202250</link>
      <description>&lt;P&gt;That is very complicated. You need get a word list dictionary.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;data have;
input have $20.;
want=strip(compbl(prxchange('s/([A-Z][a-z]+)/ $1 /',-1,have)));
cards;
EmpType
SteelIndustry
ClothingTrade 
GovernmentUSA 
LTDTrader 
;&lt;/PRE&gt;</description>
      <pubDate>Tue, 28 Jul 2020 12:53:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-space-in-a-character-string-where-there-is-a-capital/m-p/672804#M202250</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2020-07-28T12:53:25Z</dc:date>
    </item>
    <item>
      <title>Re: Create a space in a character string where there is a capital letter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-space-in-a-character-string-where-there-is-a-capital/m-p/672821#M202261</link>
      <description>This works great, thank you very much!</description>
      <pubDate>Tue, 28 Jul 2020 13:27:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-space-in-a-character-string-where-there-is-a-capital/m-p/672821#M202261</guid>
      <dc:creator>Jamie_H</dc:creator>
      <dc:date>2020-07-28T13:27:04Z</dc:date>
    </item>
    <item>
      <title>Re: Create a space in a character string where there is a capital letter</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Create-a-space-in-a-character-string-where-there-is-a-capital/m-p/672979#M202333</link>
      <description>&lt;P&gt;Since you are inserting characters you may need to create a new variable that is longer than your existing one. If any of your current values are exactly the defined length of the variable then when you insert a character in the middle the end of the value will get truncated.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jul 2020 21:24:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Create-a-space-in-a-character-string-where-there-is-a-capital/m-p/672979#M202333</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2020-07-28T21:24:03Z</dc:date>
    </item>
  </channel>
</rss>

