<?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: Import multiple Excel file into SAS, they have the same variables but all placed in different ra in SAS Data Management</title>
    <link>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360816#M10861</link>
    <description>&lt;P&gt;Not really, you are moving data from an unstructured datasource - Excel - into a structured environment. &amp;nbsp;If the data doesn't conform to some sort of standard youwill have trouble directly reading it. &amp;nbsp;Do you have SAS 9.4? &amp;nbsp;If so then you could try using libname excel:&lt;/P&gt;
&lt;PRE&gt;libname myexcel excel "path_to_your_file\your_file.xlsx";
&lt;/PRE&gt;
&lt;P&gt;Then look at the libname myexcel, this may be able to figure it out. &amp;nbsp;If not you could name the range in each sheet, that way it wouldn't matter where each block started.&lt;/P&gt;</description>
    <pubDate>Tue, 23 May 2017 16:02:11 GMT</pubDate>
    <dc:creator>RW9</dc:creator>
    <dc:date>2017-05-23T16:02:11Z</dc:date>
    <item>
      <title>Import multiple Excel file into SAS, they have the same variables but all placed in different range</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360798#M10860</link>
      <description>&lt;P&gt;Hi I'm pretty new with SAS, I have 36 Excel files, each of them have the header placed in different row,&amp;nbsp; I don't want to open each file in order to specify the range. Is there any shortcut I can use?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PROC IMPORT DATAFILE= "C:\Users\File1.xlsx"&lt;BR /&gt;OUT= phi.file1&lt;BR /&gt;DBMS=excel REPLACE;&lt;BR /&gt;getnames=yes;&lt;BR /&gt;RANGE="A6:W10000";&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;PROC IMPORT DATAFILE= "C:\Users\file2.xlsx"&lt;BR /&gt;OUT= phi.file2&lt;BR /&gt;DBMS=excel REPLACE;&lt;BR /&gt;getnames=yes;&lt;BR /&gt;RANGE="A9:W10000";&lt;BR /&gt;run;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 15:31:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360798#M10860</guid>
      <dc:creator>Sten</dc:creator>
      <dc:date>2017-05-23T15:31:21Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple Excel file into SAS, they have the same variables but all placed in different ra</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360816#M10861</link>
      <description>&lt;P&gt;Not really, you are moving data from an unstructured datasource - Excel - into a structured environment. &amp;nbsp;If the data doesn't conform to some sort of standard youwill have trouble directly reading it. &amp;nbsp;Do you have SAS 9.4? &amp;nbsp;If so then you could try using libname excel:&lt;/P&gt;
&lt;PRE&gt;libname myexcel excel "path_to_your_file\your_file.xlsx";
&lt;/PRE&gt;
&lt;P&gt;Then look at the libname myexcel, this may be able to figure it out. &amp;nbsp;If not you could name the range in each sheet, that way it wouldn't matter where each block started.&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 16:02:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360816#M10861</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2017-05-23T16:02:11Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple Excel file into SAS, they have the same variables but all placed in different ra</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360820#M10863</link>
      <description>If you are new to SAS it would definitely be faster to edit each Excel file rather than trying to solve with clever programming.&lt;BR /&gt;And when you're at it, save them as csv.</description>
      <pubDate>Tue, 23 May 2017 16:08:14 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360820#M10863</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2017-05-23T16:08:14Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple Excel file into SAS, they have the same variables but all placed in different ra</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360839#M10864</link>
      <description>&lt;P&gt;If there's a variable that you can check to see if you've reached the header row, then you could macroize (or use call execute) to run something runs something like the following for each of your files:&lt;/P&gt;
&lt;PRE&gt;libname xl xlsx '/folders/myfolders/book1.xlsx';
data have (drop=header);
  header=1;
  do until(last);
    set xl.Sheet1 end=last;
    if header then do;
      if not missing(A) then do;
        header=0;
        output;
      end;
    end;
    else output;
  end;
run;

proc export data=have outfile='/folders/myfolders/temp.csv' dbms=csv replace;
  putnames=no;
run;

proc import datafile='/folders/myfolders/temp.csv' dbms=csv out=book1 replace;
run;
&lt;/PRE&gt;
&lt;P&gt;Art, CEO, AnalystFinder.com&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 17:04:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360839#M10864</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2017-05-23T17:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Import multiple Excel file into SAS, they have the same variables but all placed in different ra</title>
      <link>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360894#M10865</link>
      <description>&lt;P&gt;You can for the end, but it's harder for the starting variable. If you know the start of the range, then there are ways to specify the end as being large.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 23 May 2017 19:42:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Data-Management/Import-multiple-Excel-file-into-SAS-they-have-the-same-variables/m-p/360894#M10865</guid>
      <dc:creator>Reeza</dc:creator>
      <dc:date>2017-05-23T19:42:27Z</dc:date>
    </item>
  </channel>
</rss>

