<?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 find the second capital letter in the data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/524998#M142814</link>
    <description>&lt;P&gt;This solution trawls through the text and puts a space next to any capital letter (so if there are 3 it will turn into 3 words)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
x='PraveenKumar';output;
x='RamSita';output;
x='JorgePaul';output;
run;

data want(drop = i letter);
set have;
attrib y length=$50;
y = "";
do i = 1 to length(x);
	letter = substr(x,i,1);
	if letter = upcase(letter) then y = catx(" ",y,letter);
	else y = cats(y,letter);
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 07 Jan 2019 10:51:45 GMT</pubDate>
    <dc:creator>DanielLangley</dc:creator>
    <dc:date>2019-01-07T10:51:45Z</dc:date>
    <item>
      <title>how to find the second capital letter in the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/524997#M142813</link>
      <description>&lt;P&gt;Hi Experts,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i have a data like below in that i need to&amp;nbsp;separate&amp;nbsp;into words&amp;nbsp; only clue we have is starting from the second Upper letter is next word.&lt;/P&gt;&lt;P&gt;for example if your take PraveenKumar i need to separate two words Praveen and Kumar.&lt;/P&gt;&lt;P&gt;Can anyone please help me how to separate the data into two words.&lt;/P&gt;&lt;P&gt;data wanted;&lt;/P&gt;&lt;P&gt;x='&lt;STRONG&gt;P&lt;/STRONG&gt;raveen&lt;STRONG&gt;K&lt;/STRONG&gt;umar';output;&lt;/P&gt;&lt;P&gt;x='&lt;STRONG&gt;R&lt;/STRONG&gt;am&lt;STRONG&gt;S&lt;/STRONG&gt;ita';output;&lt;/P&gt;&lt;P&gt;x='&lt;STRONG&gt;J&lt;/STRONG&gt;orge&lt;STRONG&gt;P&lt;/STRONG&gt;aul';output;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 10:28:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/524997#M142813</guid>
      <dc:creator>sasismylife</dc:creator>
      <dc:date>2019-01-07T10:28:47Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the second capital letter in the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/524998#M142814</link>
      <description>&lt;P&gt;This solution trawls through the text and puts a space next to any capital letter (so if there are 3 it will turn into 3 words)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
x='PraveenKumar';output;
x='RamSita';output;
x='JorgePaul';output;
run;

data want(drop = i letter);
set have;
attrib y length=$50;
y = "";
do i = 1 to length(x);
	letter = substr(x,i,1);
	if letter = upcase(letter) then y = catx(" ",y,letter);
	else y = cats(y,letter);
end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 10:51:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/524998#M142814</guid>
      <dc:creator>DanielLangley</dc:creator>
      <dc:date>2019-01-07T10:51:45Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the second capital letter in the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525000#M142816</link>
      <description>&lt;P&gt;You can solve it by using regular expressions:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
 set wanted;
 a = prxmatch('/[a-z][A-Z]/', x);
 fname = substr(x,1,a);
 lname = substr(x,a+1);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Prxmatch looks for the first combination och lowcase character followed by an uppercase character &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;//Fredrik&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 11:15:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525000#M142816</guid>
      <dc:creator>FredrikE</dc:creator>
      <dc:date>2019-01-07T11:15:32Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the second capital letter in the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525004#M142818</link>
      <description>Thanks Fredrik for your quick response.:)</description>
      <pubDate>Mon, 07 Jan 2019 11:56:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525004#M142818</guid>
      <dc:creator>sasismylife</dc:creator>
      <dc:date>2019-01-07T11:56:54Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the second capital letter in the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525006#M142820</link>
      <description>Hi Daniel,&lt;BR /&gt;&lt;BR /&gt;Thanks for your quick response:)</description>
      <pubDate>Mon, 07 Jan 2019 11:57:36 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525006#M142820</guid>
      <dc:creator>sasismylife</dc:creator>
      <dc:date>2019-01-07T11:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the second capital letter in the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525007#M142821</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;

x='PraveenKumar';output;

x='RamSita';output;

x='JorgePaul';output;

run;
data want;
set have;
fname= char(compress(x,,'KU'),1);
lname= char(compress(x,,'KU'),2);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 15:21:04 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525007#M142821</guid>
      <dc:creator>kiranv_</dc:creator>
      <dc:date>2019-01-07T15:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the second capital letter in the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525045#M142840</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;

x='PraveenKumar';output;

x='RamSita';output;

x='JorgePaul';output;

run;
data want;
set have;
_iorc_=findc (x,,'U');
First_name=substr(x,_iorc_,findc (x,,'U', _iorc_ + 1)-_iorc_);
Last_name=substr(x,findc (x,,'U', _iorc_ + 1));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 14:54:51 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525045#M142840</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-07T14:54:51Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the second capital letter in the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525046#M142841</link>
      <description>&lt;P&gt;Your code is incorrect. Needs tweaking. Char is not the function to use I am afraid&lt;/P&gt;</description>
      <pubDate>Mon, 07 Jan 2019 14:55:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525046#M142841</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-07T14:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: how to find the second capital letter in the data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525055#M142844</link>
      <description>&lt;P&gt;And another one&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;

x='PraveenKumar';output;

x='RamSita';output;

x='JorgePaul';output;

run;

data want;
set have;
First_name=substr(x,anyupper (x),anyupper (x,2)-1);
Last_name=substr(x,anyupper(x,2));
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 07 Jan 2019 15:07:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/how-to-find-the-second-capital-letter-in-the-data/m-p/525055#M142844</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-01-07T15:07:49Z</dc:date>
    </item>
  </channel>
</rss>

