<?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: Remove the uppercase in string in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813541#M321094</link>
    <description>Thank you Ballardw,&lt;BR /&gt;&lt;BR /&gt;I added the data.</description>
    <pubDate>Mon, 16 May 2022 17:49:42 GMT</pubDate>
    <dc:creator>SASdevAnneMarie</dc:creator>
    <dc:date>2022-05-16T17:49:42Z</dc:date>
    <item>
      <title>Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813490#M321074</link>
      <description>&lt;P&gt;Hello Experts,&lt;/P&gt;
&lt;P&gt;The string in my data is like :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Message&amp;nbsp;&lt;/P&gt;
&lt;P&gt;During bankAccount 'BSD0139' .&lt;/P&gt;
&lt;P&gt;Error 'MATF081' csv.&lt;/P&gt;
&lt;P&gt;Solvecy bank 'MATF026' line&lt;/P&gt;
&lt;P&gt;Programme '22337' run&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to remove all the codes like BSD0139.&lt;/P&gt;
&lt;P&gt;Do you know please the function for it ? When I'm doing&amp;nbsp;translate(Message,'','0123456789'), I remove only the numeric values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="SASdevAnneMarie_0-1652720879184.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71459iA93F9626F587C7B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="SASdevAnneMarie_0-1652720879184.png" alt="SASdevAnneMarie_0-1652720879184.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 17:49:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813490#M321074</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2022-05-16T17:49:11Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813492#M321076</link>
      <description>&lt;P&gt;Does the string ALWAYS begin with&lt;/P&gt;
&lt;PRE&gt;During bankAccount &lt;/PRE&gt;
&lt;P&gt;or can there be other beginning strings?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does the uppercase you want to remove ALWAYS begin in column 20? Or can it be other places in the string?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please explain the logic by which a programmer could find this string in the larger text string.&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 16:55:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813492#M321076</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-16T16:55:55Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813494#M321078</link>
      <description>&lt;P&gt;Not sure what UPPERCASE has to do with your quesition.&lt;/P&gt;
&lt;P&gt;If looks like you want to remove the word that follows the word "bankAccount".&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Is that the actual problem you are trying to solve?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE: The TRANSLATE() function converts individual characters.&amp;nbsp; Your code was just converting the digits into spaces.&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 16:56:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813494#M321078</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-05-16T16:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813496#M321080</link>
      <description>Hello,&lt;BR /&gt;&lt;BR /&gt;Sorry, I udated my question.&lt;BR /&gt;I would like to remove the code 'FFYY77', 'KKLM', the code is always in uppercase. The string is variable, but I have a one code in the string.</description>
      <pubDate>Mon, 16 May 2022 17:01:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813496#M321080</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2022-05-16T17:01:13Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813497#M321081</link>
      <description>Hello,&lt;BR /&gt;Sorry, I udated my question.&lt;BR /&gt;I would like to remove the code 'FFYY77', 'KKLM', the code is always in uppercase. The string is variable, but I have a one code in the string.</description>
      <pubDate>Mon, 16 May 2022 17:01:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813497#M321081</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2022-05-16T17:01:55Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813499#M321083</link>
      <description>&lt;P&gt;So when I ask for information&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;Please explain the logic by which a programmer could find this string in the larger text string.&lt;/SPAN&gt;&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;&lt;SPAN&gt;I am expecting you to respond to this request, but I don't see one.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In addition, you have now changed the problem to where the string of interest is now in quotes (whereas before it was not in quotes). Is that how the data really appears, with quotes around the string you want to remove?? Or not?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 17:06:55 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813499#M321083</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2022-05-16T17:06:55Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813530#M321089</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/286185"&gt;@SASdevAnneMarie&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;Hello,&lt;BR /&gt;Sorry, I udated my question.&lt;BR /&gt;I would like to remove the code 'FFYY77', 'KKLM', the code is always in uppercase. The string is variable, but I have a one code in the string.&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Show example data that matches your requirement and the desired result. At the time I read this your "data" has no values containing FFYY77 or KKLM&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it is only those values than perhaps TRANWRD. If it is based on position in a longer string then provide actual examples.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I see in your first post is this:&lt;/P&gt;
&lt;P&gt;The string in my data is like :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Message&amp;nbsp;&lt;/P&gt;
&lt;P&gt;During bankAccount 'BSD0139' .&lt;/P&gt;
&lt;P&gt;Error 'MATF081' csv.&lt;/P&gt;
&lt;P&gt;Solvecy bank 'MATF026' line&lt;/P&gt;
&lt;P&gt;Programme '22337' run&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to remove all the codes like BSD0139.&lt;/P&gt;
&lt;P&gt;Do you know please the function for it ? When I'm doing&amp;nbsp;translate(Message,'','0123456789'), I remove only the numeric values.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your help !&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ballardw_0-1652721970816.png" style="width: 400px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71481iD7A0F907139945E2/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ballardw_0-1652721970816.png" alt="ballardw_0-1652721970816.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 May 2022 17:27:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813530#M321089</guid>
      <dc:creator>ballardw</dc:creator>
      <dc:date>2022-05-16T17:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813541#M321094</link>
      <description>Thank you Ballardw,&lt;BR /&gt;&lt;BR /&gt;I added the data.</description>
      <pubDate>Mon, 16 May 2022 17:49:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813541#M321094</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2022-05-16T17:49:42Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813545#M321096</link>
      <description>&lt;P&gt;Many users here don't want to download Excel files because of virus potential, others have such things blocked by security software. Also if you give us Excel we have to create a SAS data set and due to the non-existent constraints on Excel data cells the result we end up with may not have variables of the same type (numeric or character) and even values.&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;The best way to provide data is via the following:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://blogs.sas.com/content/sastraining/2016/03/11/jedi-sas-tricks-data-to-data-step-macro/" target="_blank"&gt;Data2DataStep Maco instructions&lt;/A&gt; will show how to turn an existing SAS data set into data step code that can be pasted into a forum code box using the &amp;lt;&amp;gt; icon or attached as text to show exactly what you have and that we can test code against.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Having said that, and then making some assumptions about your data, you probably need to be looking at &lt;A href="https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/lefunctionsref/n0r8h2fa8djqf1n1cnenrvm573br.htm" target="_self"&gt;Regular Expressions&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Here's an example that might do what you want:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have ;
	infile cards ;
	input string $40. ;
cards ;
During bankAccount BSD0139 update.
During bankAccount MATF081 update.
During bankAccount MATF026 update
during bankAccount 22337 update
;
run ;

data want ;
	set have ;
	newString=prxchange('s/[A-Z]{3,4}[0-9]{3,4} //', -1, string);
	put string= @50 newString= ;
run ;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 16 May 2022 18:01:29 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813545#M321096</guid>
      <dc:creator>AMSAS</dc:creator>
      <dc:date>2022-05-16T18:01:29Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813740#M321184</link>
      <description>&lt;P&gt;Using Regular Expressions is one way to go about this.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To define the appropriate Regular Expression one needs to fully understand the text pattern of your source data.&lt;/P&gt;
&lt;P&gt;Based on the sample data you've posted in your Excel attachment below RegEx could work.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
  infile datalines truncover;
  input message $80.;
datalines;
Error during bankAccount CCBP294 update
Error during bankAccount CCBP297 update
Error during bankAccount UBS0138 update
Error during creation of bankAccount BGPL590 for csv line 12311
Error during bankAccount BPLL009 update
Error during bankAccount BPMC001 update
Error during creation of bankAccount CICI002 for csv line 13289
Error during bankAccount BCA1240 update
Error during creation of bankAccount MILL007 for csv line 13427
Error during bankAccount KBL0386 update
Error during bankAccount UBS0417 update
Error during bankAccount WARG100 update
Error during bankAccount BGPJ435 update
Error during bankAccount BSD1587 update
Error during creation of bankAccount COPA137 for csv line 14607
Error during deactivation of company 290
Error during deactivation of company 291
Error during deactivation of company 292
Error during deactivation of company 293
Error during deactivation of company 294
;

data want;
  set have;
  if 0 then message_2=message;
  message_2=prxchange('s/^(.*?bankaccount) \b\w*\b(.*)$/$1 &amp;lt;removed&amp;gt;$2/oi',1,strip(message));
run;

proc print data=want;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;CODE class=" language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Patrick_0-1652782031336.png" style="width: 889px;"&gt;&lt;img src="https://communities.sas.com/t5/image/serverpage/image-id/71539iB26F8DBE6B7E9D78/image-dimensions/889x549?v=v2" width="889" height="549" role="button" title="Patrick_0-1652782031336.png" alt="Patrick_0-1652782031336.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 May 2022 10:12:10 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/813740#M321184</guid>
      <dc:creator>Patrick</dc:creator>
      <dc:date>2022-05-17T10:12:10Z</dc:date>
    </item>
    <item>
      <title>Re: Remove the uppercase in string</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/814466#M321465</link>
      <description>Thank you, Amsas,&lt;BR /&gt;&lt;BR /&gt;Could you please explain what means {3,4} in your code ?</description>
      <pubDate>Fri, 20 May 2022 15:47:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-the-uppercase-in-string/m-p/814466#M321465</guid>
      <dc:creator>SASdevAnneMarie</dc:creator>
      <dc:date>2022-05-20T15:47:06Z</dc:date>
    </item>
  </channel>
</rss>

