<?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 Import Excel spreadsheet which contains two separate datasets in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238286#M43762</link>
    <description>Note: I am using PC SAS 9.4 M2(x64).&lt;BR /&gt;&lt;BR /&gt;I have some Excel spreadsheets to import and each spreadsheet contains two datasets that ate stacked horizontally.&lt;BR /&gt;&lt;BR /&gt;Upstream&lt;BR /&gt;Record_No,  Col2,  Col3,  etc&lt;BR /&gt;1                  ,  data,  data,  data&lt;BR /&gt;2                  ,  data,  data,  data&lt;BR /&gt;3                  ,  data,  data,  data&lt;BR /&gt;n.                 ,  data,  data,  data&lt;BR /&gt;Blank-row&lt;BR /&gt;Downstream&lt;BR /&gt;Record_No,  col2,  col3,  col4&lt;BR /&gt;1                 ,   data,  data, data&lt;BR /&gt;......&lt;BR /&gt;......&lt;BR /&gt;&lt;BR /&gt;I'm thinking something like import the whole sheet into a dataset. Then a proc statement data = work.upstream. work.downstream. A do until loop until the blank row or merged cell 'downstream'.  This data output to upstream and the remaining data to 'downstream'  dataset.&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be greatly appreciated&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Tue, 08 Dec 2015 15:18:08 GMT</pubDate>
    <dc:creator>K_McInvale</dc:creator>
    <dc:date>2015-12-08T15:18:08Z</dc:date>
    <item>
      <title>Import Excel spreadsheet which contains two separate datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238286#M43762</link>
      <description>Note: I am using PC SAS 9.4 M2(x64).&lt;BR /&gt;&lt;BR /&gt;I have some Excel spreadsheets to import and each spreadsheet contains two datasets that ate stacked horizontally.&lt;BR /&gt;&lt;BR /&gt;Upstream&lt;BR /&gt;Record_No,  Col2,  Col3,  etc&lt;BR /&gt;1                  ,  data,  data,  data&lt;BR /&gt;2                  ,  data,  data,  data&lt;BR /&gt;3                  ,  data,  data,  data&lt;BR /&gt;n.                 ,  data,  data,  data&lt;BR /&gt;Blank-row&lt;BR /&gt;Downstream&lt;BR /&gt;Record_No,  col2,  col3,  col4&lt;BR /&gt;1                 ,   data,  data, data&lt;BR /&gt;......&lt;BR /&gt;......&lt;BR /&gt;&lt;BR /&gt;I'm thinking something like import the whole sheet into a dataset. Then a proc statement data = work.upstream. work.downstream. A do until loop until the blank row or merged cell 'downstream'.  This data output to upstream and the remaining data to 'downstream'  dataset.&lt;BR /&gt;&lt;BR /&gt;Any suggestions would be greatly appreciated&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 08 Dec 2015 15:18:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238286#M43762</guid>
      <dc:creator>K_McInvale</dc:creator>
      <dc:date>2015-12-08T15:18:08Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel spreadsheet which contains two separate datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238293#M43768</link>
      <description>&lt;P&gt;Hi mate,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This code works as you need:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Use range option to specify the range cells and get the first table and the second, the following example i've made:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="border-collapse: collapse; width: 240pt;" border="0" width="320" cellspacing="0" cellpadding="0"&gt;&lt;COLGROUP&gt;&lt;COL style="width: 48pt;" span="5" width="64" /&gt; &lt;/COLGROUP&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD width="64" height="20" style="height: 15.0pt; width: 48pt;"&gt;TABLE1&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD width="64" style="width: 48pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;COL1&lt;/TD&gt;
&lt;TD&gt;COL2&lt;/TD&gt;
&lt;TD&gt;COL3&lt;/TD&gt;
&lt;TD&gt;COL4&lt;/TD&gt;
&lt;TD&gt;COL5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;TABLE2&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;COL1&lt;/TD&gt;
&lt;TD&gt;COL2&lt;/TD&gt;
&lt;TD&gt;COL3&lt;/TD&gt;
&lt;TD&gt;COL4&lt;/TD&gt;
&lt;TD&gt;COL5&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR style="height: 15.0pt;"&gt;
&lt;TD height="20" style="height: 15.0pt;"&gt;A&lt;/TD&gt;
&lt;TD&gt;B&lt;/TD&gt;
&lt;TD&gt;C&lt;/TD&gt;
&lt;TD&gt;D&lt;/TD&gt;
&lt;TD&gt;E&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT DATAFILE="/PATH/test.xls"
		OUT = UPSTREAM                       
    DBMS=XLS REPLACE;                                                                                                                 
    SHEET="Sheet1";                                                                                                                    
    GETNAMES=YES;                                                                                                                      
DATAROW=2;
RANGE="Sheet1$A1:E9";
RUN;

PROC IMPORT DATAFILE="/PATH/test.xls"
		OUT = DOWNSTREAM                       
    DBMS=XLS REPLACE;                                                                                                                 
    SHEET="Sheet1";                                                                                                                    
    GETNAMES=YES;                                                                                                                      
DATAROW=2;
RANGE="Sheet1$A11:E19";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 15:48:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238293#M43768</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2015-12-08T15:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel spreadsheet which contains two separate datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238299#M43772</link>
      <description>&lt;P&gt;I wouldn't import it as is. &amp;nbsp;The reason is that you will have text (downstrem) in a numeric field. &amp;nbsp;Its messy at best, and assuming a missing value is the break could be misleading. &amp;nbsp;Its another example of Excel being a problem when dealing with real data. &amp;nbsp;I would suggest you break the table yourself into two sheets, and preferentially save each sheet as CSV and write an import program for each. &amp;nbsp;This avoids the numerous issues when using Excel .&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 15:43:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238299#M43772</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-08T15:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel spreadsheet which contains two separate datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238327#M43789</link>
      <description>&lt;P&gt;Sorry, I should have been more clear.&amp;nbsp; The first section, Table1, contains 'n' observations.&amp;nbsp; I am importing from roughly 30 workbooks and n is rarely the same.&amp;nbsp; So, using range= does not help me in this situation.&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;</description>
      <pubDate>Tue, 08 Dec 2015 16:32:53 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238327#M43789</guid>
      <dc:creator>K_McInvale</dc:creator>
      <dc:date>2015-12-08T16:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel spreadsheet which contains two separate datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238335#M43791</link>
      <description>&lt;P&gt;Ok,&lt;/P&gt;
&lt;P&gt;I changed to use macro to get the values and separate the datasets:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT DATAFILE="/path/test.xls"
		OUT = FIRSTSTREAM                       
    DBMS=XLS REPLACE;                                                                                                                 
    SHEET="Sheet1";                                                                                                                    
    GETNAMES=YES;                                                                                                                      
DATAROW=3;
RUN;

DATA HAVE;
   SET FIRSTSTREAM;
   X = _N_;
RUN;

PROC SQL;
  SELECT X+2    INTO: FIRSTLINE FROM HAVE WHERE TABLE1 = "";
  SELECT MAX(X) INTO: LASTLINE  FROM HAVE;
QUIT;


PROC IMPORT DATAFILE="/path/test.xls"
		OUT = UPSTREAM                       
    DBMS=XLS REPLACE;                                                                                                                 
    SHEET="Sheet1";                                                                                                                    
    GETNAMES=YES;                                                                                                                      
DATAROW=2;
RANGE="Sheet1$A1:E&amp;amp;FIRSTLINE.";
RUN;

PROC IMPORT DATAFILE="/path/test.xls"
		OUT = DOWNSTREAM                       
    DBMS=XLS REPLACE;                                                                                                                 
    SHEET="Sheet1";                                                                                                                    
    GETNAMES=YES;                                                                                                                      
DATAROW=2;
RANGE="Sheet1$A&amp;amp;FIRSTLINE.:E&amp;amp;LASTLINE.";
RUN;

&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 08 Dec 2015 16:53:31 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238335#M43791</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2015-12-08T16:53:31Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel spreadsheet which contains two separate datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238351#M43792</link>
      <description>&lt;P&gt;Could you post one of your Excel files? The proper approach depends a lot on data structure and layout.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 17:48:25 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238351#M43792</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2015-12-08T17:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel spreadsheet which contains two separate datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238365#M43794</link>
      <description>&lt;P&gt;Excellent point Mr Respected Advisor! I have a dummy workbook and I will place an image here as well.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;IMG title="dummy_image.png" alt="dummy_image.png" src="https://communities.sas.com/t5/image/serverpage/image-id/1091i6194E5967A2890B2/image-size/original?v=mpbl-1&amp;amp;px=-1" border="0" /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2015 19:10:02 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238365#M43794</guid>
      <dc:creator>K_McInvale</dc:creator>
      <dc:date>2015-12-08T19:10:02Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel spreadsheet which contains two separate datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238476#M43814</link>
      <description>&lt;P&gt;Which shows my example nicely. &amp;nbsp;What you have posted is a best case scenario, all the columns are text, and the same structure. &amp;nbsp;Is your data really like that, I wouldn't think so. &amp;nbsp;So what will you do if:&lt;/P&gt;
&lt;P&gt;- col1 is missing for any reason within the data?&lt;/P&gt;
&lt;P&gt;- numbers where previous table is characters&lt;/P&gt;
&lt;P&gt;- different numbers of columns&lt;/P&gt;
&lt;P&gt;These are a few things that spring to mind, not to mention hidded data, special characters, no fixed setup, so could change at further attempts etc. &amp;nbsp;Why are you importing this data in the first place, why not access the Raw data this was produced from? &amp;nbsp;I mentioned this in another topic, but one of the big reasons to avoid Excel as an output format is the general misconception that it is a data transfer format and can be used as such (unlike Word/PDF), hence we end up trying to read in output review files, which is what you are trying to do here, rather than go through a strcutured validated robust approach of:&lt;/P&gt;
&lt;P&gt;- create data import specifcation&lt;/P&gt;
&lt;P&gt;- get agreement on file format (using proper data transfer file formats = CSV, XML etc.)&lt;/P&gt;
&lt;P&gt;- create import program based on specifcations&lt;/P&gt;
&lt;P&gt;- run program on test data and validate&lt;/P&gt;
&lt;P&gt;- run at each import occasion and validate&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 09:17:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238476#M43814</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2015-12-09T09:17:14Z</dc:date>
    </item>
    <item>
      <title>Re: Import Excel spreadsheet which contains two separate datasets</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238492#M43819</link>
      <description>&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;PROC IMPORT DATAFILE="/path/test.xls"
		OUT = FIRSTSTREAM                       
    DBMS=XLS REPLACE;                                                                                                                 
    SHEET="Sheet1";                                                                                                                    
    GETNAMES=YES;                                                                                                                      
DATAROW=3;
RUN;

DATA HAVE;
   SET FIRSTSTREAM;
   X = _N_;
RUN;

PROC SQL;
  SELECT X+2    INTO: FIRSTLINE FROM HAVE WHERE TABLE1 = "";
  SELECT MAX(X) INTO: LASTLINE  FROM HAVE;
QUIT;


PROC IMPORT DATAFILE="/path/test.xls"
		OUT = UPSTREAM                       
    DBMS=XLS REPLACE;                                                                                                                 
    SHEET="Sheet1";                                                                                                                    
    GETNAMES=YES;                                                                                                                      
DATAROW=2;
RANGE="Sheet1$A1:E&amp;amp;FIRSTLINE.";
RUN;

PROC IMPORT DATAFILE="/path/test.xls"
		OUT = DOWNSTREAM                       
    DBMS=XLS REPLACE;                                                                                                                 
    SHEET="Sheet1";                                                                                                                    
    GETNAMES=YES;                                                                                                                      
DATAROW=2;
RANGE="Sheet1$A&amp;amp;FIRSTLINE.:E&amp;amp;LASTLINE.";
RUN;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This code do exactly what you need, and you don't need to specify which one is the line to breakup the tables.&lt;BR /&gt;You only have to change the where clause in proc sql.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps&lt;/P&gt;</description>
      <pubDate>Wed, 09 Dec 2015 12:00:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Import-Excel-spreadsheet-which-contains-two-separate-datasets/m-p/238492#M43819</guid>
      <dc:creator>DartRodrigo</dc:creator>
      <dc:date>2015-12-09T12:00:01Z</dc:date>
    </item>
  </channel>
</rss>

