<?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: Importing specific Excel .xlsx rows in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138939#M28071</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;When my code says &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;drop table id, A10B10, A11B11, dum, B12Y12, B24Y24, B25Y25, B35Y35, tl, t;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;it simply means DELETE these tables. NOTEs in the log are just information message and usually do not require corrective action. I delete these intermediate tables to clean up, but also to make sure the next time the macro is called an old dataset will not be read instead of a new one that failed to be created.&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;PG&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 04 Sep 2014 15:52:21 GMT</pubDate>
    <dc:creator>PGStats</dc:creator>
    <dc:date>2014-09-04T15:52:21Z</dc:date>
    <item>
      <title>Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138916#M28048</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I posted this in the statistical procedures section by accident, but I think it is more appropriate here. I'm new to the board. I apologize for the duplicate posts.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm relatively new to the DATA and PROC IMPORT steps of SAS (am more statistics oriented and have not managed importing data into SAS, specifically) and I'm wondering if there is a way to import specific rows into SAS. The problem with my Excel sheets is that they contain a lot of data in rows that I don't need. Also, the first line of the Excel sheet is not a list of variable names (I didn't design these spreadsheets, obviously!).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Specifically, this is what I need to do:&lt;/P&gt;&lt;P&gt;Import cell B2 (this is study ID#) and then import A10, B10 and A11, B11. Then I would like B12 - Y12 (these are time variables) and then B24 - Y24 (the values that correspond to B12-Y12 variables).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anything in an A cell is a variable, but I don't necessarily NEED it as I could figure out what variable I'm looking at later on.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are multiple worksheets in each workbook, and I am willing to read each workbook/worksheet in by hand if necessary.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ordinarily I would run a macro/VBA in Excel to get this info but our security policies are such that we aren't allowed to run macros in Excel or Access!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All suggestions appreciated!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 27 Jul 2014 21:26:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138916#M28048</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-07-27T21:26:45Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138917#M28049</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Assuming each part of your data has a uniform data type (character or numeric), you can read all the parts (ranges) in separate datasets with the LIBNAME Engine :&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;libname xl Excel "&amp;amp;sasforum\datasets\copony.xlsx" header=no access=readonly;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table id as select F1 as ID from xl.'Sheet1$B2:B2'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table A10B10 as select F1 as A10, F2 as B10 from xl.'Sheet1$A10:B10'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table A11B11 as select F1 as A11, F2 as B11 from xl.'Sheet1$A11:B11'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table B12Y12 as select * from xl.'Sheet1$B12:Y12'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table B24Y24 as select * from xl.'Sheet1$B24:Y24'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;libname xl clear;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you read Excel data without column names (header=no) the variables take the names F1, F2, etc.&lt;/P&gt;&lt;P&gt;You can then combine the parts (SAS datasets id, A10B10, A11B11, B12Y12, B24Y24) with other SQL or data steps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 28 Jul 2014 03:23:23 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138917#M28049</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-07-28T03:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138918#M28050</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you very much PGStats - the import worked. The only thing is that the data in cells B12-Y12 is 24 hour style time (e.g., 0:00, 1:00, 2:00 through 24:00). The time converts to "30Dec1899" for all the values in the SAS Table. Do you know of a code to transform this back into time points?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 15:59:46 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138918#M28050</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-07-30T15:59:46Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138919#M28051</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can do this at the input stage using the dbsastype option.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;proc sql;&lt;/P&gt;&lt;P&gt;create table b12y12 as select * from xl.'Sheet1$B12:Y12'n (dbsastype=(b12="time" ...));&lt;/P&gt;&lt;P&gt;quit;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 16:13:56 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138919#M28051</guid>
      <dc:creator>FriedEgg</dc:creator>
      <dc:date>2014-07-30T16:13:56Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138920#M28052</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It might be less trouble to use libname options telling SAS to watch for time values:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;libname xl Excel "&amp;amp;sasforum\datasets\copony.xlsx" header=no access=readonly &lt;SPAN style="color: #800000;"&gt;usedate=yes scantime=yes&lt;/SPAN&gt;;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table id as select F1 as ID from xl.'Feuil1$B2:B2'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table A10B10 as select F1 as A10, F2 as B10 from xl.'Feuil1$A10:B10'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table A11B11 as select F1 as A11, F2 as B11 from xl.'Feuil1$A11:B11'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table B12Y12 as select * &lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;from xl.'Feuil1$B12:Y12'n&lt;/SPAN&gt;&lt;SPAN style="font-size: 10pt; line-height: 1.5em;"&gt;;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table B24Y24 as select * from xl.'Feuil1$B24:Y24'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;libname xl clear;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 16:53:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138920#M28052</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-07-30T16:53:57Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138921#M28053</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;@FriedEgg, when I input exactly as you wrote I get "&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG style="color: #993300;"&gt;ERROR: Invalid syntax for option DBSASTYPE'&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;I also tried inputting without the ellipses and got "&lt;SPAN style="font-family: courier new,courier;"&gt;&lt;STRONG style="color: #993300;"&gt;ERROR: Invalid column name specified DBSASTYPE option: b12&lt;/STRONG&gt;&lt;/SPAN&gt;'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Am I omitting something? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 17:01:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138921#M28053</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-07-30T17:01:28Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138922#M28054</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Awesome &lt;A __default_attr="2746" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;, that was the trick! Thanks so much!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, since there are multiple worksheets, how do I combine all the tables so I can get one table of all the values? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 17:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138922#M28054</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-07-30T17:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138923#M28055</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, first, how do you want the 5 ranges extracted from a single worksheet to be combined into a dataset? - PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 17:15:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138923#M28055</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-07-30T17:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138924#M28056</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well... &lt;A __default_attr="2746" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;--B12Y12 is the clock time 00:00 through 24:00 and it is consistent throughout all sheets&lt;/P&gt;&lt;P&gt;--B2 is a unique ID specific to the following variables:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --A10:B10 is variable1:string value for variable 1&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --A11:B11 is variable2:string value for variable 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --B24:Y24 are numeric values that correspond to the time in B12:Y12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --B25:Y25 are numeric values that correspond to the time in B12:Y12&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; --B35:Y35 are numeric values that correspond to the time in B12:Y12&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There are roughly 100 unique IDs (identified in B2 in each sheet), each ID has an average of 3 corresponding worksheets of data. Each sheet has the same layout, but it represents a different day of values recorded for the unique ID. Did I explain this clearly? Please let me know if I can clarify further. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 17:33:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138924#M28056</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-07-30T17:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138925#M28057</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;How can you tell apart the dates corresponding to a given ID?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 17:44:57 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138925#M28057</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-07-30T17:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138926#M28058</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;B10 in each sheet is actually a date/time it's a string value due to the way it was entered in the original Excel worksheet, example: 21October2010/2345. &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 18:05:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138926#M28058</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-07-30T18:05:58Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138927#M28059</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think something like this should work.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* Define a macro to read one worksheet */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%macro getdata(file,ds);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;libname xl Excel "&amp;amp;sasforum\datasets\&amp;amp;file..xlsx" header=no access=readonly usedate=yes scantime=yes;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table id as select F1 as ID from xl.'Sheet1$B2:B2'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table A10B10 as select catx(" ", F1, F2) as date from xl.'Sheet1$A10:B10'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table A11B11 as select catx(" ", F1, F2) as var2 from xl.'Sheet1$A11:B11'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table t as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * from xl.'Sheet1$B12:Y12'n &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;union all&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * from xl.'Sheet1$B24:Y24'n&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;union all&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * from xl.'Sheet1$B25:Y25'n&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;union all&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select * from xl.'Sheet1$B35:Y35'n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;libname xl clear;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc transpose data=t out=tl; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table &amp;amp;ds as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var2, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col1 as t, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col2 as val1 format=best.,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col3 as val2 format=best.,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col4 as val3 format=best.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from id, A10B10, A11B11, tl;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop table id, A10B10, A11B11, tl, t;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* Call the macro */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%getdata(copony,ds001);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* ... repeat for all data files. Give all output datasets names starting with ds */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* Assemble all datasets that have names starting with ds */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data allDs;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set ds:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 30 Jul 2014 18:34:01 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138927#M28059</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-07-30T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138928#M28060</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="2746" __jive_macro_name="user" class="jive_macro jive_macro_user" href="https://communities.sas.com/"&gt;&lt;/A&gt; Thanks for your code (sorry for my delayed response - I had a death in my family last month and am just getting back into this SAS project) conceptually it seems sound but I'm getting many errors... can you (or anyone) help me figure out why I'm getting so many errors when I run the code? Errors are as follows: &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;65&amp;nbsp;&amp;nbsp; from id, A10C10, A11B11, tl;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;66&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;67&amp;nbsp;&amp;nbsp; drop table id, A10C10, A11B11, tl, t;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;68&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;69&amp;nbsp;&amp;nbsp; quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;70&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;71&amp;nbsp;&amp;nbsp; %mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;72&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;73&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;74&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;75&amp;nbsp;&amp;nbsp; /* Call the macro */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;76&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;77&amp;nbsp;&amp;nbsp; %getdata(copony,ds001);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Libref XL was successfully assigned as follows:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Engine:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; EXCEL&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Physical Name: &lt;SPAN style="font-size: 11.0pt; font-family: 'Calibri','sans-serif';"&gt;"&amp;amp;sasforum\datasets\&amp;amp;file.&lt;/SPAN&gt;xlsx&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Table WORK.ID created, with 1 rows and 1 columns.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Table WORK.A10C10 created, with 1 rows and 1 columns.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Table WORK.A11B11 created, with 1 rows and 1 columns.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Column 1 from the first contributor of UNION ALL is not the same type as its counterpart&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from the second.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Column 2 from the first contributor of UNION ALL is not the same type as its counterpart&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from the second.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Column 3 from the first contributor of UNION ALL is not the same type as its counterpart&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; from the second.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;(and so on through row 24...)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;and:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: PROCEDURE SQL used (Total process time):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 2.16 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.43 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Libref XL has been deassigned.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: File WORK.T.DATA does not exist.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: The data set WORK.TL may be incomplete.&amp;nbsp; When this step was stopped there were 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; observations and 0 variables.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: PROCEDURE TRANSPOSE used (Total process time):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.14 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Table WORK.TL doesn't have any columns. PROC SQL requires each of its tables to have at&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; least 1 column.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Character expression requires a character format.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Character expression requires a character format.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Character expression requires a character format.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: The following columns were not found in the contributing tables: col1, col2, col3, col4.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Table WORK.ID has been dropped.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Table WORK.A10C10 has been dropped.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Table WORK.A11B11 has been dropped.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Table WORK.TL has been dropped.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: File WORK.T.DATA does not exist.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: Table WORK.T has not been dropped.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;78&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;And finally:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;86&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;87&amp;nbsp;&amp;nbsp; set ds:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: The data set list (WORK.ds:) does not contain any members.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;88&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;89&amp;nbsp;&amp;nbsp; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: The data set WORK.ALLDS may be incomplete.&amp;nbsp; When this step was stopped there were 0&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; observations and 0 variables.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: DATA statement used (Total process time):&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; real time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.51 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; cpu time&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.04 seconds&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 17:38:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138928#M28060</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-09-03T17:38:06Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138929#M28061</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Welcome back. Sorry for your loss.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;&amp;amp;sasforum\datasets\&lt;/STRONG&gt;&lt;/SPAN&gt; isn't a path that is meaningful in your envirionment. It is defined on my machine to point to a particular folder. You should replace it with the location of your xlsx files; something like&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;libname xl Excel "&lt;SPAN style="color: #800000;"&gt;C:\temp\&lt;/SPAN&gt;&amp;amp;file..xlsx"&lt;/STRONG&gt;&lt;/SPAN&gt; ...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 17:52:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138929#M28061</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-09-03T17:52:33Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138930#M28062</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="2746" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt; thanks for responding so quickly!&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_text_macro jive_macro_quote" modifiedtitle="true"&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;&amp;amp;sasforum\datasets\&lt;/STRONG&gt;&lt;/SPAN&gt;isn't a path that is meaningful in your envirionment. It is defined on my machine to point to a particular folder. You should replace it with the location of your xlsx files; something like
&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN style="font-family: 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: #ffffff;"&gt;&lt;STRONG&gt;libname xl Excel "&lt;SPAN style="color: #800000;"&gt;C:\temp\&lt;/SPAN&gt;&amp;amp;file..xlsx"&lt;/STRONG&gt;&lt;/SPAN&gt; ...&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;Yes - I definitely know this and had replaced that path with one that is meaningful in my environment - I just didn't want to post it on a public forum :-). Even with the correct path, I still got all those errors... &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 17:59:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138930#M28062</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-09-03T17:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138931#M28063</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ok then, Read a single workbook and check that the types (character or number) of corresponding variables in datasets B12Y12, B24Y24, B25Y25 and B35Y35 all match. The error message says they don't, which makes the fields impossible to combine.&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 18:24:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138931#M28063</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-09-03T18:24:33Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138932#M28064</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Some of the corresponding values for the variables are missing. Could that be the problem? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 18:35:44 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138932#M28064</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-09-03T18:35:44Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138933#M28065</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-family: calibri, verdana, arial, sans-serif; font-size: 12pt;"&gt;&lt;SPAN lang="EN-CA"&gt;Yes it could. As far as I can tell (this is not documented) the type of missing values in Excel is determined by their format. Missing values without a format as assumed to be character. W&lt;/SPAN&gt;hether you want to correct the workbooks or fix the problem by programming depends on your patience and the number of workbooks involved. In other words, you could assign formats to Excel ranges or do some fancy footwork in SAS.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 18:52:22 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138933#M28065</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-09-03T18:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138934#M28066</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I think I might have to use SAS, however complicated, because I can't run macros in Excel due to our security policies and there are many workbooks containing multiple worksheets. Where should I begin in SAS? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 18:56:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138934#M28066</guid>
      <dc:creator>copony</dc:creator>
      <dc:date>2014-09-03T18:56:42Z</dc:date>
    </item>
    <item>
      <title>Re: Importing specific Excel .xlsx rows</title>
      <link>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138935#M28067</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;OK. Here is a new version that should tolerate the presence of character variables in the imported ranges. They are transformed into missing values.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%macro getdata(file,ds,Sheet);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;libname xl Excel "&amp;amp;sasforum\datasets\&amp;amp;file..xlsx" header=no access=readonly usedate=yes scantime=yes;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data B12Y12;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set xl."&amp;amp;Sheet.$B12:Y12"n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;keep _NUMERIC_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data B24Y24;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set xl."&amp;amp;Sheet.$B24:Y24"n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;keep _NUMERIC_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data B25Y25;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set xl."&amp;amp;Sheet.$B25:Y25"n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;keep _NUMERIC_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data B35Y35;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set xl."&amp;amp;Sheet.$B35:Y35"n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;keep _NUMERIC_;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table id as select F1 as ID from xl."&amp;amp;Sheet.$B2:B2"n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table A10B10 as select catx(" ", F1, F2) as date from xl."&amp;amp;Sheet.$A10:B10"n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table A11B11 as select catx(" ", F1, F2) as var2 from xl."&amp;amp;Sheet.$A11:B11"n;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;libname xl clear;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* Empty dataset to ensure the presence of all 24 variables F1-F24 */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data dum; array F[24]; stop; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data t;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set dum B12Y12 B24Y24 B25Y25 B35Y35;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc transpose data=t out=tl; var f1-f24; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;proc sql; &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;create table &amp;amp;ds as&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;select &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; id, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; date, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; var2, &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col1 as t , &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col2 as val1 format=best.,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col3 as val2 format=best.,&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; col4 as val3 format=best.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;from id, A10B10, A11B11, tl;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drop table id, A10B10, A11B11, dum, B12Y12, B24Y24, B25Y25, B35Y35, tl, t;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;quit;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%mend;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;option mprint; /* for testing */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;%getdata(copony,ds001,Sheet1);&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* ... repeat for all worksheets. give all output datasets names starting with ds */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;/* Assemble all datasets that have names starting with ds */&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;data allDs;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;set ds:;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;PG&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 03 Sep 2014 21:38:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/Importing-specific-Excel-xlsx-rows/m-p/138935#M28067</guid>
      <dc:creator>PGStats</dc:creator>
      <dc:date>2014-09-03T21:38:32Z</dc:date>
    </item>
  </channel>
</rss>

