<?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 How to Import multiple excel file at a time in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/How-to-Import-multiple-excel-file-at-a-time/m-p/515047#M138944</link>
    <description>&lt;P&gt;How do we import multiple excel files for a particula library at a time in SAS with different extensions ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg:&amp;nbsp;E:\than\proc.excel&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;E:\than\test.excel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; E:\than\final.excel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;E:\than\week.excel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;.....&amp;nbsp; &amp;nbsp; &amp;nbsp;so on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to read all the above file at a time into SAS..?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Nov 2018 10:59:26 GMT</pubDate>
    <dc:creator>vThanu</dc:creator>
    <dc:date>2018-11-21T10:59:26Z</dc:date>
    <item>
      <title>How to Import multiple excel file at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Import-multiple-excel-file-at-a-time/m-p/515047#M138944</link>
      <description>&lt;P&gt;How do we import multiple excel files for a particula library at a time in SAS with different extensions ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;eg:&amp;nbsp;E:\than\proc.excel&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;E:\than\test.excel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; E:\than\final.excel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;E:\than\week.excel&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;.....&amp;nbsp; &amp;nbsp; &amp;nbsp;so on.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I want to read all the above file at a time into SAS..?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Nov 2018 10:59:26 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Import-multiple-excel-file-at-a-time/m-p/515047#M138944</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2018-11-21T10:59:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to Import multiple excel file at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Import-multiple-excel-file-at-a-time/m-p/515050#M138945</link>
      <description>&lt;P&gt;&lt;SPAN&gt;"AS with different extensions&amp;nbsp;" - what does this mean.&amp;nbsp; Do you have xls, xlsx etc. files?&amp;nbsp; If so you need a different dbms for each type.&amp;nbsp; What operating system?&amp;nbsp; For unix based systems you will need PCFILES server for instance.&amp;nbsp; On Windows if you have Office installed it may be easier.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;"I want to read all the above file at a time into SAS..?" - and how will this work, will you just be leaving it to proc import to guess what the data should look like - i.e. Garbage in garbage out?&amp;nbsp; What you get from that will likely not be exactly what you think you will get.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;As for how to do it, get a list of files from command prompt and then call a macro e.g. (windows);&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;filename tmp pipe 'dir "e:/than/*.*" /b';

data _null_;
  infile tmp dlm="¬";
  input;
  if index(upcase(_infile_),"XLS") then call execute(cats('%imp_xls (fnam=',_infile_,');'));
  else call execute(cats('%imp_xlsx (fnam=',_infile_,');'));
run;&lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Nov 2018 11:12:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Import-multiple-excel-file-at-a-time/m-p/515050#M138945</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-21T11:12:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to Import multiple excel file at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Import-multiple-excel-file-at-a-time/m-p/515294#M139000</link>
      <description>&lt;P&gt;In windows environment only and one specific library with differe file name with same extension...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;using macro&amp;nbsp; I want to import (read) mutliple file into SAS at a time.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 06:35:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Import-multiple-excel-file-at-a-time/m-p/515294#M139000</guid>
      <dc:creator>vThanu</dc:creator>
      <dc:date>2018-11-22T06:35:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to Import multiple excel file at a time</title>
      <link>https://communities.sas.com/t5/SAS-Programming/How-to-Import-multiple-excel-file-at-a-time/m-p/515306#M139004</link>
      <description>&lt;P&gt;Use the code provided, minor change if they are all xlsx files (remember that what you get from this maybe garbage - Excel is a bad data source, and proc import is a guessing procedure, combined they are not good):&lt;/P&gt;
&lt;PRE&gt;filename tmp pipe 'dir "e:/than/*.xlsx" /b';

data _null_;
  infile tmp dlm="¬";
  input;
  call execute(cats('proc import file="e:/than/',_infile_,'" out=want',put(_n_,best.),' replace dbms=xlsx; run;'));
run;&lt;/PRE&gt;
&lt;P&gt;This will create one proc import for each file in the given directory, and create an output dataset wantX where X is incremental.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 22 Nov 2018 08:11:33 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/How-to-Import-multiple-excel-file-at-a-time/m-p/515306#M139004</guid>
      <dc:creator>RW9</dc:creator>
      <dc:date>2018-11-22T08:11:33Z</dc:date>
    </item>
  </channel>
</rss>

