<?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: Adding a space for names in a column in All Things Community</title>
    <link>https://communities.sas.com/t5/All-Things-Community/Adding-a-space-for-names-in-a-column/m-p/934996#M4945</link>
    <description>&lt;P&gt;Thank you so much!!&lt;/P&gt;</description>
    <pubDate>Mon, 08 Jul 2024 16:43:42 GMT</pubDate>
    <dc:creator>jwint12</dc:creator>
    <dc:date>2024-07-08T16:43:42Z</dc:date>
    <item>
      <title>Adding a space for names in a column</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Adding-a-space-for-names-in-a-column/m-p/934986#M4943</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I have a data set in excel that has Owner City, Owner state, and owner zip in separate columns. I needed to combine these 3 columns into one with a comma separating owner city from owner state and then a space in between owner state and owner zip. Here is the code I have. SAS has correctly combined all columns into 1, which is named combined. Owner city is separated from owner state with a comma, but owner state is not separated from owner zip. This is an example of what is coming back to me.&amp;nbsp; Augusta, GA30909.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need it to look like Augusta, GA 30909. Thank you to anyone willing to help!!&lt;/P&gt;&lt;P&gt;data aik.props_new1;&lt;BR /&gt;set aik.props_news;&lt;BR /&gt;combined= cats(Owner_City, ' , ' Owner_State, '&amp;nbsp; ' , Owner_Zip);&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 16:12:17 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Adding-a-space-for-names-in-a-column/m-p/934986#M4943</guid>
      <dc:creator>jwint12</dc:creator>
      <dc:date>2024-07-08T16:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a space for names in a column</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Adding-a-space-for-names-in-a-column/m-p/934992#M4944</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data a;
    owner_city='Auburn';
    owner_state='GA';
    owner_zip=12345;
    combined=cat(trim(left(Owner_City)), ', ',trim(left(owner_state)), ' ' , trim(left(Owner_Zip)));
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can't use CATS for this because CATS will eliminate text strings that are all blanks, which is what you are seeing.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 16:36:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Adding-a-space-for-names-in-a-column/m-p/934992#M4944</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2024-07-08T16:36:13Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a space for names in a column</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Adding-a-space-for-names-in-a-column/m-p/934996#M4945</link>
      <description>&lt;P&gt;Thank you so much!!&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 16:43:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Adding-a-space-for-names-in-a-column/m-p/934996#M4945</guid>
      <dc:creator>jwint12</dc:creator>
      <dc:date>2024-07-08T16:43:42Z</dc:date>
    </item>
    <item>
      <title>Re: Adding a space for names in a column</title>
      <link>https://communities.sas.com/t5/All-Things-Community/Adding-a-space-for-names-in-a-column/m-p/934997#M4946</link>
      <description>&lt;P&gt;Use CATX() if you want to insert delimiters between strings.&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;combined= catx(' ',catx(', ',Owner_City, Owner_State), Owner_Zip);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The problem with CATS() is the S which means STRIP(), so it throws away the space.&amp;nbsp; The CATX() function will also strip the values, but not the delimiter sting.&amp;nbsp; So you can create:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;New York, NY 10001&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;from 'New York[,'NY', and '10061'&lt;/P&gt;</description>
      <pubDate>Mon, 08 Jul 2024 16:56:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/All-Things-Community/Adding-a-space-for-names-in-a-column/m-p/934997#M4946</guid>
      <dc:creator>Tom</dc:creator>
      <dc:date>2024-07-08T16:56:15Z</dc:date>
    </item>
  </channel>
</rss>

