<?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: I need to delete dots from string and not include any space in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899954#M355669</link>
    <description>&lt;P&gt;I am not able to reproduce this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    name = 'Paige Miller Corp, L.L.C.';
run;
data want;
    set have;
    newname=compress(name,'.');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result does not have L L C with spaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The bigger problem of matching corporation names that may indeed have different punctuation or spacing or spelling is one that&amp;nbsp;&lt;EM&gt;might&lt;/EM&gt; be solved by something called &lt;A href="https://blogs.sas.com/content/sgf/2021/09/21/fuzzy-matching/" target="_self"&gt;fuzzy matching&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Oct 2023 13:06:03 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2023-10-25T13:06:03Z</dc:date>
    <item>
      <title>I need to delete dots from string and not include any space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899951#M355668</link>
      <description>&lt;P&gt;I have a list of companies that I have to cross to another list of companies by name.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can imagine, the main problem with this task is that usually, the companies' names end with letters as LLC in USA or SA or SL in Spain.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem with this topic is that in some cases LLC can be written LLC or L.L.C., so that I need to delete the dots, and in this case, if I use TRANWRD or COMPRESS, after deleting the dot, the process is including an space, so I obtain L L C when I need to obtain LLC&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some examples of my code:&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;PRE&gt;&lt;CODE class=""&gt;OPTION 1:
tranwrd(tranwrd(compbl(upcase(NAME)),'.',''),',','') as NEW_NAME

OPTION 2:
compress(compbl(upcase(NAME)),',.') as NEW_NAME&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Any ideas on how can I resolve this matter?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 12:52:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899951#M355668</guid>
      <dc:creator>xavimjo</dc:creator>
      <dc:date>2023-10-25T12:52:09Z</dc:date>
    </item>
    <item>
      <title>Re: I need to delete dots from string and not include any space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899954#M355669</link>
      <description>&lt;P&gt;I am not able to reproduce this&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
    name = 'Paige Miller Corp, L.L.C.';
run;
data want;
    set have;
    newname=compress(name,'.');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The result does not have L L C with spaces.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The bigger problem of matching corporation names that may indeed have different punctuation or spacing or spelling is one that&amp;nbsp;&lt;EM&gt;might&lt;/EM&gt; be solved by something called &lt;A href="https://blogs.sas.com/content/sgf/2021/09/21/fuzzy-matching/" target="_self"&gt;fuzzy matching&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 13:06:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899954#M355669</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-25T13:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: I need to delete dots from string and not include any space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899959#M355671</link>
      <description>&lt;P&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/10892"&gt;@PaigeMiller&lt;/a&gt;'s suggestion will remove all dots.&amp;nbsp; This might be exactly what you need.&amp;nbsp; OR, removing all might be too much.&amp;nbsp; You could also try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;tranwrd('L.L.C', 'LLC')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then you need a separate statement for each word such as S.A. or S.L.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also note, if the length of your new variable has not been defined, many character functions assign a length of $200.&amp;nbsp; You could overcome that by assigning a proper length at the beginning of the DATA step, before applying any functions.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 13:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899959#M355671</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2023-10-25T13:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: I need to delete dots from string and not include any space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899965#M355674</link>
      <description>&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/459586"&gt;@xavimjo&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;
&lt;P&gt;I have a list of companies that I have to cross to another list of companies by name.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As you can imagine, the main problem with this task is that usually, the companies' names end with letters as LLC in USA or SA or SL in Spain.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The problem with this topic is that in some cases LLC can be written LLC or L.L.C., so that I need to delete the dots, and in this case, if I use TRANWRD or COMPRESS, after deleting the dot, the process is including an space, so I obtain L L C when I need to obtain LLC&lt;/P&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Are you sure the company's name doesn't contain L. L. C. with spaces in it as well as dots?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you provide us with a small portion of the data that illustrates the problem?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Oct 2023 14:14:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899965#M355674</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2023-10-25T14:14:02Z</dc:date>
    </item>
    <item>
      <title>Re: I need to delete dots from string and not include any space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899993#M355686</link>
      <description>&lt;P&gt;If you want to REMOVE the periods then why did you replace them with a single space by calling TRANWRD()?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;tranwrd(XXX,',','')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Note that just typing the quotes enclosing a string literal next to each other does not create an empty string. Instead it creates a string with one space.&amp;nbsp; Get in the habit of typing it that way to begin with to avoid confusion.&amp;nbsp; Also it will make it easier to tell that it is two single quote characters and not one double quote character.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;tranwrd(XXX,',',' ')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To remove individual characters (bytes) use COMPRESS().&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;compress(XXX,',')&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;To transform a multi-byte string to nothing you have to use TRANSTRN() instead of TRANWRD().&amp;nbsp; To generate an empty string you have to use TRIMN().&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;transtrn(XXX,',',trimn(' '))&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Oct 2023 15:33:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/899993#M355686</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2023-10-25T15:33:42Z</dc:date>
    </item>
    <item>
      <title>Re: I need to delete dots from string and not include any space</title>
      <link>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/900101#M355740</link>
      <description>&lt;P&gt;Hello PaigeMiller, today the code is working, but&amp;nbsp;I don't understand why wasn't working properly yesterday.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The final code that I'm using is this one:&lt;/P&gt;&lt;PRE&gt;compress(compbl(upcase(NAME)),',.') as NEW_NAME&lt;/PRE&gt;&lt;P&gt;Thanks a lot four your suggestion about&amp;nbsp;fuzzy matching, I find very interesting the post, and it will be in my mind for the future.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 09:35:49 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/I-need-to-delete-dots-from-string-and-not-include-any-space/m-p/900101#M355740</guid>
      <dc:creator>xavimjo</dc:creator>
      <dc:date>2023-10-26T09:35:49Z</dc:date>
    </item>
  </channel>
</rss>

