<?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 Character in String in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/Remove-Character-in-String/m-p/799426#M33163</link>
    <description>Thank you!</description>
    <pubDate>Tue, 01 Mar 2022 19:12:43 GMT</pubDate>
    <dc:creator>Jesusismygrace</dc:creator>
    <dc:date>2022-03-01T19:12:43Z</dc:date>
    <item>
      <title>Remove Character in String</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-Character-in-String/m-p/799227#M33145</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I read the previous solutions on this board on removing a character from a string, but I still do not understand it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have a field called Code and in this field, there are some "." that I would like to remove (J.045).&lt;/P&gt;
&lt;P&gt;The below is what I have so far, but it does not work:&lt;/P&gt;
&lt;P&gt;Data VSD22;&lt;BR /&gt;Set VSD21;&lt;BR /&gt;Code=tranwrd(Code,'.','');&lt;BR /&gt;end;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you in advance&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 00:13:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-Character-in-String/m-p/799227#M33145</guid>
      <dc:creator>Jesusismygrace</dc:creator>
      <dc:date>2022-03-01T00:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Character in String</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-Character-in-String/m-p/799238#M33146</link>
      <description>&lt;P&gt;To remove characters use COMPRESS().&amp;nbsp; To end a data step use RUN statement.&amp;nbsp; END is use to end a DO loop, which your code does not include.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data VSD22;
  set VSD21;
  Code=compress(Code,'.');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;TRANWRD() is for replacing strings with other strings. Example: tranwrd(string,'hello','good-bye')&lt;/P&gt;
&lt;P&gt;Normal SAS syntax does not generate empty string, so just because you did not type the space between the quotes you still gave tranwrd a string with one space to replace the string with one period.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to replace a string with nothing you will need to use TRANSTRN() function.&amp;nbsp; To actually create an empty string instead of the string with one blank space you would need to use TRIMN() function.&amp;nbsp; Example: transtrn(string,'remove me',trimn(' '))&lt;/P&gt;</description>
      <pubDate>Tue, 01 Mar 2022 20:12:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-Character-in-String/m-p/799238#M33146</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2022-03-01T20:12:45Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Character in String</title>
      <link>https://communities.sas.com/t5/New-SAS-User/Remove-Character-in-String/m-p/799426#M33163</link>
      <description>Thank you!</description>
      <pubDate>Tue, 01 Mar 2022 19:12:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/Remove-Character-in-String/m-p/799426#M33163</guid>
      <dc:creator>Jesusismygrace</dc:creator>
      <dc:date>2022-03-01T19:12:43Z</dc:date>
    </item>
  </channel>
</rss>

