<?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 changing case of a specific word in a string. in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609957#M177600</link>
    <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data chk;
input name $9.;
name = tranwrd(name,"ae","AE");
cards;
aedef
ae
sae
dftaes ae
aerae
;
run;&lt;BR /&gt;&lt;BR /&gt;I need&amp;nbsp;the&amp;nbsp;output&amp;nbsp;as&amp;nbsp;below:&lt;BR /&gt;aedef,&lt;BR /&gt;AE,&lt;BR /&gt;sae,&lt;BR /&gt;dftaes&amp;nbsp;AE,&lt;BR /&gt;aerae&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;I need&amp;nbsp;change&amp;nbsp;the&amp;nbsp;case&amp;nbsp;of&amp;nbsp;word&amp;nbsp;&lt;STRONG&gt;ae&lt;/STRONG&gt;&amp;nbsp;to&amp;nbsp;&lt;STRONG&gt;AE&amp;nbsp;&lt;/STRONG&gt;only if&amp;nbsp;it&amp;nbsp;exists&amp;nbsp;as&amp;nbsp;a&amp;nbsp;word&amp;nbsp;but&amp;nbsp;not&amp;nbsp;in&amp;nbsp;between&amp;nbsp;a&amp;nbsp;word&lt;BR /&gt;&lt;BR /&gt;Thanks&amp;nbsp;in&amp;nbsp;advance,&lt;BR /&gt;J.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 06 Dec 2019 14:26:05 GMT</pubDate>
    <dc:creator>Srikanth_J</dc:creator>
    <dc:date>2019-12-06T14:26:05Z</dc:date>
    <item>
      <title>changing case of a specific word in a string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609957#M177600</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data chk;
input name $9.;
name = tranwrd(name,"ae","AE");
cards;
aedef
ae
sae
dftaes ae
aerae
;
run;&lt;BR /&gt;&lt;BR /&gt;I need&amp;nbsp;the&amp;nbsp;output&amp;nbsp;as&amp;nbsp;below:&lt;BR /&gt;aedef,&lt;BR /&gt;AE,&lt;BR /&gt;sae,&lt;BR /&gt;dftaes&amp;nbsp;AE,&lt;BR /&gt;aerae&lt;BR /&gt;&lt;BR /&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;CODE class=" language-sas"&gt;&lt;BR /&gt;I need&amp;nbsp;change&amp;nbsp;the&amp;nbsp;case&amp;nbsp;of&amp;nbsp;word&amp;nbsp;&lt;STRONG&gt;ae&lt;/STRONG&gt;&amp;nbsp;to&amp;nbsp;&lt;STRONG&gt;AE&amp;nbsp;&lt;/STRONG&gt;only if&amp;nbsp;it&amp;nbsp;exists&amp;nbsp;as&amp;nbsp;a&amp;nbsp;word&amp;nbsp;but&amp;nbsp;not&amp;nbsp;in&amp;nbsp;between&amp;nbsp;a&amp;nbsp;word&lt;BR /&gt;&lt;BR /&gt;Thanks&amp;nbsp;in&amp;nbsp;advance,&lt;BR /&gt;J.&lt;/CODE&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 06 Dec 2019 14:26:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609957#M177600</guid>
      <dc:creator>Srikanth_J</dc:creator>
      <dc:date>2019-12-06T14:26:05Z</dc:date>
    </item>
    <item>
      <title>Re: changing case of a specific word in a string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609963#M177603</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211995"&gt;@Srikanth_J&lt;/a&gt;&amp;nbsp; &amp;nbsp;What you need is FINDW as opposed to TRANWRD&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;if findw(name,'ae') then substr(name,findw(name,'ae'),2)='AE';

/*Using your example*/
data chk;
input name $9.;
name2=name;
if findw(name2,'ae') then substr(name2,findw(name2,'ae'),2)='AE';
cards;
aedef
ae
sae
dftaes ae
aerae
;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2019 14:39:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609963#M177603</guid>
      <dc:creator>novinosrin</dc:creator>
      <dc:date>2019-12-06T14:39:10Z</dc:date>
    </item>
    <item>
      <title>Re: changing case of a specific word in a string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609964#M177604</link>
      <description>&lt;P&gt;You can use the INDEXW() function to find the locations where ae appears as a word.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data chk;
  input name $9.;
  do while(indexw(name,'ae'));
    substr(name,indexw(name,'ae'),2)='AE';
  end;
cards;
aedef
ae
sae
dftaes ae
aerae
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2019 14:40:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609964#M177604</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2019-12-06T14:40:21Z</dc:date>
    </item>
    <item>
      <title>Re: changing case of a specific word in a string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609966#M177606</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/211995"&gt;@Srikanth_J&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try this also&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data chk;
input name $9.;
name2 = strip(prxchange('s/(^|\s)(ae)(\s|$)/ AE /',-1,name));
cards;
aedef
ae
sae
dftaes ae
aerae
;
run;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 06 Dec 2019 14:48:50 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609966#M177606</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2019-12-06T14:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: changing case of a specific word in a string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609968#M177608</link>
      <description>Thank you &lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/138205"&gt;@novinosrin&lt;/a&gt;.</description>
      <pubDate>Fri, 06 Dec 2019 14:51:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/609968#M177608</guid>
      <dc:creator>Srikanth_J</dc:creator>
      <dc:date>2019-12-06T14:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: changing case of a specific word in a string.</title>
      <link>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/610193#M177685</link>
      <description>&lt;PRE&gt;data have;
input name $9.;
name2 = prxchange('s/\b(ae)\b/\U\1/',-1,name);
cards;
aedef
ae
sae
dftaes ae
aerae
;
run;&lt;/PRE&gt;</description>
      <pubDate>Sat, 07 Dec 2019 11:50:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/changing-case-of-a-specific-word-in-a-string/m-p/610193#M177685</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2019-12-07T11:50:39Z</dc:date>
    </item>
  </channel>
</rss>

