<?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 Hyphen / Space / Underlines but no compressing? in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626503#M184809</link>
    <description>&lt;P&gt;You can use the TRANSLATE function. Example to replace underscores and hyphens with a blank:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   z=translate(y,' ','_-');
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 21 Feb 2020 16:23:35 GMT</pubDate>
    <dc:creator>PaigeMiller</dc:creator>
    <dc:date>2020-02-21T16:23:35Z</dc:date>
    <item>
      <title>Remove Hyphen / Space / Underlines but no compressing?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626497#M184807</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would like to remove all th eHyphen / Space / Underlines in the dataset 'Text'&amp;nbsp;but no compressing, just leave the number and letter with space formats.&amp;nbsp; Thanks.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Text;
      infile datalines dsd;
  input NewID : $15. TempID_1 : $15.  TempID_2 : $15. TempID_3 : $15. TempID_4 : $15.;
datalines;
1156 IL, 89__46, 88--53, , , 
1487 KM, __8956, _78-52__, , ,
000-597, -1596_, 4113, , ,
C_ _-1156, 4986__, 0_0-0_8, , ,
208, 8M _ O23, , , ,
_21156--, 89   66, 885 - 2, 5 5 5 9, , 
;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 16:12:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626497#M184807</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2020-02-21T16:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Hyphen / Space / Underlines but no compressing?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626503#M184809</link>
      <description>&lt;P&gt;You can use the TRANSLATE function. Example to replace underscores and hyphens with a blank:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   z=translate(y,' ','_-');
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 16:23:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626503#M184809</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-21T16:23:35Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Hyphen / Space / Underlines but no compressing?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626509#M184811</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/67134"&gt;@ybz12003&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Does this output meet your expectations? If not, please specify the expected output.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;best,&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Text;
      infile datalines dsd;
  input NewID : $15. TempID_1 : $15.  TempID_2 : $15. TempID_3 : $15. TempID_4 : $15.;
datalines;
1156 IL, 89__46, 88--53, , , 
1487 KM, __8956, _78-52__, , ,
000-597, -1596_, 4113, , ,
C_ _-1156, 4986__, 0_0-0_8, , ,
208, 8M _ O23, , , ,
_21156--, 89   66, 885 - 2, 5 5 5 9, , 
;

data want;
	set Text;
	array _var (*) NewID TempID_1-TempID_4;
	do i=1 to dim(_var);
		_var(i) = prxchange('s/^\s|-|_|\s$/ /',-1,_var(i));
	end;
	drop i;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 16:30:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626509#M184811</guid>
      <dc:creator>ed_sas_member</dc:creator>
      <dc:date>2020-02-21T16:30:45Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Hyphen / Space / Underlines but no compressing?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626513#M184812</link>
      <description>&lt;P&gt;To steal the logic from&amp;nbsp;&lt;a href="https://communities.sas.com/t5/user/viewprofilepage/user-id/292097"&gt;@ed_sas_member&lt;/a&gt;&amp;nbsp;and use TRANSLATE()&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data Text;
      infile datalines dsd;
  input NewID : $15. TempID_1 : $15.  TempID_2 : $15. TempID_3 : $15. TempID_4 : $15.;
  array _var(*) newid tempid_1-tempid_4;
  do i=1 to dim(_var);
      _var(i)=translate(_var(i),' ','-_');
	end;
datalines;
1156 IL, 89__46, 88--53, , , 
1487 KM, __8956, _78-52__, , ,
000-597, -1596_, 4113, , ,
C_ _-1156, 4986__, 0_0-0_8, , ,
208, 8M _ O23, , , ,
_21156--, 89   66, 885 - 2, 5 5 5 9, , 
;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 21 Feb 2020 16:42:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626513#M184812</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2020-02-21T16:42:00Z</dc:date>
    </item>
    <item>
      <title>Re: Remove Hyphen / Space / Underlines but no compressing?</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626516#M184813</link>
      <description>&lt;P&gt;Thank you so much for all of wonderful help!&lt;/P&gt;</description>
      <pubDate>Fri, 21 Feb 2020 16:54:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Remove-Hyphen-Space-Underlines-but-no-compressing/m-p/626516#M184813</guid>
      <dc:creator>ybz12003</dc:creator>
      <dc:date>2020-02-21T16:54:14Z</dc:date>
    </item>
  </channel>
</rss>

