<?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: How to separate one column with multi name cities, state and zipcode into separate columns in New SAS User</title>
    <link>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840198#M36411</link>
    <description>Sorry about that.</description>
    <pubDate>Mon, 24 Oct 2022 05:46:37 GMT</pubDate>
    <dc:creator>talisman</dc:creator>
    <dc:date>2022-10-24T05:46:37Z</dc:date>
    <item>
      <title>How to separate one column with multi name cities, state and zipcode into separate columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840186#M36406</link>
      <description>&lt;P&gt;one column named City_State_Zipcode and the data looks like this in the column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Brooklyn NY 11218&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; West Haven MN 99556&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; West Charlotte NC 12563&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you separate that one column into three separate columns named City, State, Zipcode&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 03:11:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840186#M36406</guid>
      <dc:creator>talisman</dc:creator>
      <dc:date>2022-10-24T03:11:13Z</dc:date>
    </item>
    <item>
      <title>How to separate one column with multi name cities, state and zipcode into separate columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840191#M36408</link>
      <description>&lt;P&gt;one column named City_State_Zipcode and the data looks like this in the column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Brooklyn NY 11218&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; West Haven MN 99556&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; West Charlotte NC 12563&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do you separate that one column into three separate columns named City, State, Zipcode?&lt;/P&gt;&lt;P&gt;When I try to do it, West will end up in the City column and Haven will be in the State column and MN will be in the zipcode column&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 03:58:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840191#M36408</guid>
      <dc:creator>talisman</dc:creator>
      <dc:date>2022-10-24T03:58:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate one column with multi name cities, state and zipcode into separate columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840192#M36407</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data have;
input City_State_Zipcode $30.;
datalines;
Brooklyn NY 11218       
West Haven MN 99556     
West Charlotte NC 12563 
;

data want(drop = pos length);
   set have;
   call scan(City_State_Zipcode, -2, pos, length);
   city  = substr(City_State_Zipcode, 1, pos-2);
   state = scan(City_State_Zipcode, -2);
   zip   = scan(City_State_Zipcode, -1);
run;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Oct 2022 04:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840192#M36407</guid>
      <dc:creator>PeterClemmensen</dc:creator>
      <dc:date>2022-10-24T04:00:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate one column with multi name cities, state and zipcode into separate columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840193#M36409</link>
      <description>&lt;P&gt;Try it this way:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;data want;
   set have;
   zip = scan(city_state_zipcode, -1);
   state = scan(city_state_zipcode, -1);
   city = substr(city_state_zipcode, 1, length(city_state_zipcode) - 8);
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;The final formula might need to be adjusted if it is possible that some STATE values have a length other than 2, or some zipcodes have a length other than 5.&amp;nbsp; But if this gives the answer as is, let's leave out the complexities.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 04:04:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840193#M36409</guid>
      <dc:creator>Astounding</dc:creator>
      <dc:date>2022-10-24T04:04:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate one column with multi name cities, state and zipcode into separate columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840196#M36410</link>
      <description>&lt;P&gt;Please do not double-post.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Oct 2022 04:25:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840196#M36410</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2022-10-24T04:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to separate one column with multi name cities, state and zipcode into separate columns</title>
      <link>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840198#M36411</link>
      <description>Sorry about that.</description>
      <pubDate>Mon, 24 Oct 2022 05:46:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/New-SAS-User/How-to-separate-one-column-with-multi-name-cities-state-and/m-p/840198#M36411</guid>
      <dc:creator>talisman</dc:creator>
      <dc:date>2022-10-24T05:46:37Z</dc:date>
    </item>
  </channel>
</rss>

