<?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 _ and create a space in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/remove-and-create-a-space/m-p/784360#M32081</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you want something that looks more like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   my_new_county = tranwrd(county,"_", " ");&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 06 Dec 2021 18:50:48 GMT</pubDate>
    <dc:creator>HB</dc:creator>
    <dc:date>2021-12-06T18:50:48Z</dc:date>
    <item>
      <title>remove _ and create a space</title>
      <link>https://communities.sas.com/t5/New-SAS-User/remove-and-create-a-space/m-p/784358#M32080</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am working with a data set of county names. Some have underscores such as Kit_Carson and I want to replace the _ with a regular space so that it reads (Kat Carson). I need to remove all underscores in the entire data set. I am unsure of how to complete this step. I just transposed my data from wide to long, and now trying to remove the _. I think I can do this in the tranwrd step, but when searching this topic I can only find the opposite of what I need so I am looking for some guidance here. This is what my code I am working with looks like what what I am trying to create.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you!&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PROC TRANSPOSE DATA = fixedcounty OUT= names;&lt;BR /&gt;var county:;&lt;BR /&gt;run; &lt;BR /&gt;&lt;BR /&gt;data names;&lt;BR /&gt;set names;&lt;BR /&gt;county=tranwrd(_name_,"county", "");&lt;BR /&gt;run;&lt;/P&gt;
&lt;P&gt;proc contents data=fixedcounty varnum;&lt;BR /&gt;run;&lt;BR /&gt;proc print data=fixedcounty;&lt;BR /&gt;run;&lt;BR /&gt;proc print data= names; &lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 18:35:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/remove-and-create-a-space/m-p/784358#M32080</guid>
      <dc:creator>Guerraje</dc:creator>
      <dc:date>2021-12-06T18:35:03Z</dc:date>
    </item>
    <item>
      <title>Re: remove _ and create a space</title>
      <link>https://communities.sas.com/t5/New-SAS-User/remove-and-create-a-space/m-p/784360#M32081</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think you want something that looks more like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;   my_new_county = tranwrd(county,"_", " ");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Dec 2021 18:50:48 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/remove-and-create-a-space/m-p/784360#M32081</guid>
      <dc:creator>HB</dc:creator>
      <dc:date>2021-12-06T18:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: remove _ and create a space</title>
      <link>https://communities.sas.com/t5/New-SAS-User/remove-and-create-a-space/m-p/784361#M32082</link>
      <description>&lt;P&gt;So you have variable named COUNTY that contains values like '&lt;SPAN&gt;Kit_Carson'?&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;You can use the TRANSLATE() function to replace characters with other characters.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  county=translate(county,' ','_');
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;SPAN&gt;I am not sure how PROC TRANSPOSE is supposed to help you.&amp;nbsp; If you have multiple COUNTY variables then use an ARRAY.&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
  set have;
  array vars county: ;
  do over vars;
    vars=translate(vars,' ','_');
  end;
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 06 Dec 2021 18:57:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/remove-and-create-a-space/m-p/784361#M32082</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2021-12-06T18:57:28Z</dc:date>
    </item>
  </channel>
</rss>

