<?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: Reading in an Oddly Formatted Excel File in SAS in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161885#M42097</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the data the exact same in each file, ie same row/same column? If so you could do it "manually" once using DDE and then run for each file.&lt;/P&gt;&lt;P&gt;Still a pain though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 03 Dec 2013 23:11:05 GMT</pubDate>
    <dc:creator>Reeza</dc:creator>
    <dc:date>2013-12-03T23:11:05Z</dc:date>
    <item>
      <title>Reading in an Oddly Formatted Excel File in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161882#M42094</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have some oddly formatted data from an excel spread sheet I'm trying to read in. A sample of the excel file I'm trying to read in is below. So in particular there are two challenges. I would like to ignore the title and start reading in and get names from the top header: Date, A, B, C, D, E, F, Time/Date. This is an sample of the spread sheet: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" style="width: 1122px;"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD class="xl71" height="18" width="64"&gt;&lt;P&gt;&lt;/P&gt;&lt;/TD&gt;&lt;TD class="xl71" colspan="3" width="426"&gt;TITLE&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl74" height="42" rowspan="2" style="border-bottom: 1.0pt solid black;" width="64"&gt;Date&lt;/TD&gt;&lt;TD class="xl72" rowspan="2" style="border-bottom: 1.0pt solid black;" width="76"&gt;A&lt;/TD&gt;&lt;TD class="xl72" rowspan="2" style="border-bottom: 1.0pt solid black;" width="64"&gt;B&lt;/TD&gt;&lt;TD class="xl72" rowspan="2" style="border-bottom: 1.0pt solid black;" width="286"&gt;C&lt;/TD&gt;&lt;TD class="xl72" rowspan="2" style="border-bottom: 1.0pt solid black;" width="71"&gt;D&lt;/TD&gt;&lt;TD class="xl72" rowspan="2" style="border-bottom: 1.0pt solid black;" width="69"&gt;E&lt;/TD&gt;&lt;TD class="xl72" rowspan="2" style="border-bottom: 1.0pt solid black;" width="64"&gt;F&lt;/TD&gt;&lt;TD class="xl65" width="428"&gt;Time&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl66" height="18" width="428"&gt;Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="17" width="64"&gt;January&lt;/TD&gt;&lt;TD class="xl67" width="76"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="286"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="71"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="69"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="428"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl68" height="36" width="64"&gt;1/20/2004&lt;/TD&gt;&lt;TD class="xl69" width="76"&gt;Company A&lt;/TD&gt;&lt;TD class="xl69" width="64"&gt;2:00 p.m.&lt;/TD&gt;&lt;TD class="xl69" width="286"&gt;Connecticut&lt;/TD&gt;&lt;TD class="xl69" width="71"&gt;NA&lt;/TD&gt;&lt;TD class="xl69" width="69"&gt;4,000&lt;/TD&gt;&lt;TD class="xl69" width="64"&gt;400,00&lt;/TD&gt;&lt;TD class="xl69" width="428"&gt;1/26/04, 9:00 a.m.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="17" width="64"&gt;February&lt;/TD&gt;&lt;TD class="xl67" width="76"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="286"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="71"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="69"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="64"&gt; &lt;/TD&gt;&lt;TD class="xl67" width="428"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD align="right" class="xl68" height="36" width="64"&gt;2/12/2004&lt;/TD&gt;&lt;TD class="xl69" width="76"&gt;Company B&lt;/TD&gt;&lt;TD class="xl69" width="64"&gt;11:32 a.m.&lt;/TD&gt;&lt;TD class="xl69" width="286"&gt;San Francisco&lt;/TD&gt;&lt;TD class="xl69" width="71"&gt;NA&lt;/TD&gt;&lt;TD align="right" class="xl70" width="69"&gt;1,000&lt;/TD&gt;&lt;TD class="xl69" width="64"&gt; 340,000&lt;/TD&gt;&lt;TD class="xl69" width="428"&gt;3/01/04, 8:50 a.m.&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl67" height="17" width="64"&gt; 2/28/2004&lt;/TD&gt;&lt;TD class="xl67" width="76"&gt;CompanyC &lt;/TD&gt;&lt;TD class="xl67" width="64"&gt;1:00 pm &lt;/TD&gt;&lt;TD class="xl67" width="286"&gt;New York &lt;/TD&gt;&lt;TD class="xl67" width="71"&gt;NA &lt;/TD&gt;&lt;TD class="xl67" width="69"&gt;NA &lt;/TD&gt;&lt;TD class="xl67" width="64"&gt;NA &lt;/TD&gt;&lt;TD class="xl67" width="428"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD class="xl69" height="17" width="64"&gt;None&lt;/TD&gt;&lt;TD&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The Date column is particularly tricky for me because it has January and February, etc followed by MM/DD/YYYY format beneath it. How can I just read in the MM/DD/YYYY, and ignore the January, February, March, etc or place it side by side while reading in such as&amp;nbsp; January 1/20/2004, in separate columns, and then the same for February, etc. So When reading in I would like to see something like&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;TABLE border="0" cellpadding="0" cellspacing="0" width="574"&gt;&lt;TBODY&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD class="xl23" height="35" width="64"&gt;Month&lt;/TD&gt;&lt;TD width="64"&gt;Date&lt;/TD&gt;&lt;TD class="xl22" style="border-bottom: 1.0pt solid black;" width="64"&gt;A&lt;/TD&gt;&lt;TD class="xl22" style="border-bottom: 1.0pt solid black;" width="64"&gt;B&lt;/TD&gt;&lt;TD class="xl22" style="border-bottom: 1.0pt solid black;" width="64"&gt;C&lt;/TD&gt;&lt;TD class="xl22" style="border-bottom: 1.0pt solid black;" width="64"&gt;D&lt;/TD&gt;&lt;TD class="xl22" style="border-bottom: 1.0pt solid black;" width="64"&gt;E&lt;/TD&gt;&lt;TD class="xl22" style="border-bottom: 1.0pt solid black;" width="62"&gt;F&lt;/TD&gt;&lt;TD class="xl23" style="border-left: none;" width="64"&gt;Time/Date&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD class="xl23" height="35" style="border-top: none;" width="64"&gt;January&lt;/TD&gt;&lt;TD class="xl24" style="border-left: none;" width="64"&gt;1/20/2004&lt;/TD&gt;&lt;TD class="xl23" style="border-left: none;" width="64"&gt;Company A&lt;/TD&gt;&lt;TD class="xl23" style="border-left: none;" width="64"&gt;2:00 p.m.&lt;/TD&gt;&lt;TD class="xl23" style="border-left: none;" width="64"&gt;Connecticut&lt;/TD&gt;&lt;TD class="xl23" style="border-left: none;" width="64"&gt;NA&lt;/TD&gt;&lt;TD align="right" class="xl25" style="border-left: none;" width="64"&gt;4,000&lt;/TD&gt;&lt;TD class="xl23" style="border-left: none;" width="62"&gt;400,00&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;1/26/04, 9:00 a.m.&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD class="xl23" height="35" style="border-top: none;" width="64"&gt;February&lt;/TD&gt;&lt;TD class="xl24" style="border-top: none; border-left: none;" width="64"&gt;2/12/2004&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;Company B&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;11:32 a.m.&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;San Francisco&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;NA&lt;/TD&gt;&lt;TD class="xl26" style="border-top: none; border-left: none;" width="64"&gt;1,000&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="62"&gt; 340,000&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;3/01/04, 8:50 a.m.&lt;/TD&gt;&lt;/TR&gt;&lt;TR style="border: inherit solid inherit;"&gt;&lt;TD class="xl23" height="35" style="border-top: none;" width="64"&gt;February&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt; 2/28/2004&lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;CompanyC &lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;1:00 pm &lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;New York &lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;NA &lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt;NA &lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="62"&gt;NA &lt;/TD&gt;&lt;TD class="xl23" style="border-top: none; border-left: none;" width="64"&gt; &lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Any suggestions?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using this code to begin reading the file in:&lt;/P&gt;&lt;P&gt;PROC IMPORT OUT= WORK.Out&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; DATAFILE= "C:\Users\Desktop\Data\Excel1.xls" &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; DBMS=EXCEL REPLACE;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RANGE="Sheet1$"; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; GETNAMES=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; MIXED=NO;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCANTEXT=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; USEDATE=YES;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; SCANTIME=YES;&lt;/P&gt;&lt;P&gt;RUN;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 06:59:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161882#M42094</guid>
      <dc:creator>steppermotor</dc:creator>
      <dc:date>2013-12-03T06:59:47Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in an Oddly Formatted Excel File in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161883#M42095</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Reading Excel files like this is like reading reports.&lt;/P&gt;&lt;P&gt;The best option if available is to try to get a more clean layout from your source (this is to done on a regular basis right?, otherwise fix the Excel manually first).&lt;/P&gt;&lt;P&gt;Is the month name in a separate cell/row?&lt;/P&gt;&lt;P&gt;Either way, import, and then do some data step programming to fix it in the way you like it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 17:29:09 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161883#M42095</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2013-12-03T17:29:09Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in an Oddly Formatted Excel File in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161884#M42096</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yeah, I don't mind fixing the excel manually except. I have a several files that I would have to do so, it seems being able to read in the native format with sas would be the best strategy. The Time and Date are in a separate cell/row. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 23:00:15 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161884#M42096</guid>
      <dc:creator>steppermotor</dc:creator>
      <dc:date>2013-12-03T23:00:15Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in an Oddly Formatted Excel File in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161885#M42097</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is the data the exact same in each file, ie same row/same column? If so you could do it "manually" once using DDE and then run for each file.&lt;/P&gt;&lt;P&gt;Still a pain though.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 03 Dec 2013 23:11:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161885#M42097</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-12-03T23:11:05Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in an Oddly Formatted Excel File in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161886#M42098</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So I guess there's no easy ways to do this in sas?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 02:00:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161886#M42098</guid>
      <dc:creator>steppermotor</dc:creator>
      <dc:date>2013-12-04T02:00:31Z</dc:date>
    </item>
    <item>
      <title>Re: Reading in an Oddly Formatted Excel File in SAS</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161887#M42099</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I don't think there's an easy way in any language &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt;&lt;/P&gt;&lt;P&gt;There are ways though..&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 04 Dec 2013 15:31:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Reading-in-an-Oddly-Formatted-Excel-File-in-SAS/m-p/161887#M42099</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2013-12-04T15:31:46Z</dc:date>
    </item>
  </channel>
</rss>

