<?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 Messy data in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Messy-data/m-p/113783#M23466</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I have a messy data which need to be organized. The original file has 500 variables, but for simplicity I came up with a sample excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;The data has two columns school and contact.&amp;nbsp; The contact information needs to be organized into separate columns (name address phone fax web). The final output should have the following columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; school&amp;nbsp; name&amp;nbsp; address&amp;nbsp; phone&amp;nbsp; fax&amp;nbsp;&amp;nbsp;&amp;nbsp; web&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I appreciate your suggestions and help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;TBODY style="font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;School&lt;/TD&gt;&lt;TD class="xl64" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;Contact&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="69" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CASTILLEJA SCHOOL&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;Nancy Ware&amp;nbsp; 1310 Bryant Street&amp;nbsp; Palo Alto California&amp;nbsp; 94301 Phone: (508) 626-1567&amp;nbsp; Fax: (508) 872-0260 &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.aasearch.net/" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;http://www.aaspjhasjearch.net&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="69" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CHALLENGER SCHOOL&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;Wiedmann 1185 Hollenback Avenue&amp;nbsp; Sunnyvale California 94086 Phone:(954) 689-3984&amp;nbsp; Fax:(954) 689-3985 &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.aajtech.com/" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;http://www.akhsksajtech.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="52" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CENTRAL MIDDLE SCHOOL&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;Jan Dresser 828 Chestnut Street San Carlos California 94070&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.aprimesolution.com/" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;http://www.aprjaurpimkesolution.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="35" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;Cesar Chavez Academy&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;2450 Ralmar Avenue East Palo Alto California&amp;nbsp; 94303&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CLIFFORD SCHOOL&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;&lt;A class="jive-link-external-small" href="http://www.cliffordschool.com/" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;http://www.cliffodf0galschool.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;Costano School&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;Charles Salter&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="52" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CRITTENDEN MIDDLE SCHOOL&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;C. Anzia, Robin Russell, Joyce Murphree and Barbara Saxton phone: (123) 456-7890&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 19 Feb 2013 09:18:20 GMT</pubDate>
    <dc:creator>thummala</dc:creator>
    <dc:date>2013-02-19T09:18:20Z</dc:date>
    <item>
      <title>Messy data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Messy-data/m-p/113783#M23466</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;Hi&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I have a messy data which need to be organized. The original file has 500 variables, but for simplicity I came up with a sample excel sheet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;The data has two columns school and contact.&amp;nbsp; The contact information needs to be organized into separate columns (name address phone fax web). The final output should have the following columns&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; school&amp;nbsp; name&amp;nbsp; address&amp;nbsp; phone&amp;nbsp; fax&amp;nbsp;&amp;nbsp;&amp;nbsp; web&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;I appreciate your suggestions and help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="border: 0px; font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;TBODY style="font-style: inherit; font-family: inherit;"&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;School&lt;/TD&gt;&lt;TD class="xl64" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;Contact&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="69" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CASTILLEJA SCHOOL&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;Nancy Ware&amp;nbsp; 1310 Bryant Street&amp;nbsp; Palo Alto California&amp;nbsp; 94301 Phone: (508) 626-1567&amp;nbsp; Fax: (508) 872-0260 &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.aasearch.net/" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;http://www.aaspjhasjearch.net&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="69" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CHALLENGER SCHOOL&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;Wiedmann 1185 Hollenback Avenue&amp;nbsp; Sunnyvale California 94086 Phone:(954) 689-3984&amp;nbsp; Fax:(954) 689-3985 &lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.aajtech.com/" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;http://www.akhsksajtech.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="52" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CENTRAL MIDDLE SCHOOL&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;&lt;SPAN style="font-style: inherit; font-family: inherit;"&gt;Jan Dresser 828 Chestnut Street San Carlos California 94070&lt;/SPAN&gt;&lt;A class="jive-link-external-small" href="http://www.aprimesolution.com/" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;http://www.aprjaurpimkesolution.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="35" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;Cesar Chavez Academy&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;2450 Ralmar Avenue East Palo Alto California&amp;nbsp; 94303&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CLIFFORD SCHOOL&lt;/TD&gt;&lt;TD style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;"&gt;&lt;A class="jive-link-external-small" href="http://www.cliffordschool.com/" style="font-style: inherit; font-family: inherit; color: #0e66ba;"&gt;http://www.cliffodf0galschool.com&lt;/A&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="20" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;Costano School&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;Charles Salter&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: 0px; font-style: inherit; font-family: inherit;"&gt;&lt;TD class="xl63" height="52" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="163"&gt;CRITTENDEN MIDDLE SCHOOL&lt;/TD&gt;&lt;TD class="xl63" style="padding-right: 4px; padding-left: 4px; border: 0px solid black; font-style: inherit; font-family: inherit;" width="227"&gt;C. Anzia, Robin Russell, Joyce Murphree and Barbara Saxton phone: (123) 456-7890&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 09:18:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Messy-data/m-p/113783#M23466</guid>
      <dc:creator>thummala</dc:creator>
      <dc:date>2013-02-19T09:18:20Z</dc:date>
    </item>
    <item>
      <title>Re: Messy data</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Messy-data/m-p/113784#M23467</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Thummala,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Since the data is in excel Sheet you can directly import it, using proc import.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In the Second variable has to be devided in to various of iuts sub values as Name, and address, phone etc. but there are no delimiters as mentioned in the sample data. My sugesstions are in steps asd below:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;gt;&amp;nbsp;&amp;nbsp; Using index &amp;amp; substr&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; #Get the 'Index value' for numbers(0123456789), if its not '1' then there is some value before the door number that would be probably the name. you can substr it by using the length as 'index value' -1.&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; #Index for 'Phone' &amp;amp; 'Fax' by this you can take the values of address Phone # and Fax # accordingly.&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; #If there is any othere value remaining in the variable that would be the web page&lt;/P&gt;&lt;P&gt;If the index value goes '0' then the indexing value should be moved to the next indexing value and should be carried on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This is just a idea and is not fool proof though... you can just try with this as a begining.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Moovendhan D&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 19 Feb 2013 09:56:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Messy-data/m-p/113784#M23467</guid>
      <dc:creator>DMoovendhan</dc:creator>
      <dc:date>2013-02-19T09:56:47Z</dc:date>
    </item>
  </channel>
</rss>

