<?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 multi Excel files in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18364#M3587</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But when I replace "1." with "4.", it turns out that none of files could be read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, thanks for your reply!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 13 Jul 2012 14:20:54 GMT</pubDate>
    <dc:creator>hilary27</dc:creator>
    <dc:date>2012-07-13T14:20:54Z</dc:date>
    <item>
      <title>Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18355#M3578</link>
      <description>Hi Everyone,&lt;BR /&gt;
&lt;BR /&gt;
Could someone please show me how to import multiple Excel files into a data set? My below code just to read in one file. Thank you for your help. It's much appreciated.&lt;BR /&gt;
&lt;BR /&gt;
proc import datafile="C:\SAS\data\&amp;amp;filename." &lt;BR /&gt;
	out=temp&lt;BR /&gt;
	replace;&lt;BR /&gt;
	DBSASLABEL=NONE;&lt;BR /&gt;
	MIXED=YES;&lt;BR /&gt;
	run;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
data datain;&lt;BR /&gt;
	attrib	id_nbr	length=$20. &lt;BR /&gt;
    		name	length=$50.&lt;BR /&gt;
    		address	length=$50.&lt;BR /&gt;
    		city	length=$50.&lt;BR /&gt;
    		state	length=$50.&lt;BR /&gt;
    		zip	length=$50.&lt;BR /&gt;
    		;&lt;BR /&gt;
	set temp;&lt;BR /&gt;
run;</description>
      <pubDate>Fri, 07 May 2010 21:31:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18355#M3578</guid>
      <dc:creator>Lani</dc:creator>
      <dc:date>2010-05-07T21:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18356#M3579</link>
      <description>Conditions of Code are&lt;BR /&gt;
1.Your operation system is Windows.&lt;BR /&gt;
2.There is only one sheet in each xls files.&lt;BR /&gt;
3.All of your xls files is in "d:\download\"&lt;BR /&gt;
4.You only need to modify '2' in the code. i.e.  if you have eight xls files ,only  change 2 into 8; &lt;BR /&gt;
&lt;BR /&gt;
First,you need to put the following code in one Edit Windows to make up a Marco(merge).&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
options mprint mlogic symbolgen;&lt;BR /&gt;
%macro merge(n);*n is the number of your xls files;&lt;BR /&gt;
%do i=1 %to &amp;amp;n;&lt;BR /&gt;
    proc import out=datafile&amp;amp;i datafile="&amp;amp;&amp;amp;file&amp;amp;i"  dbms=excel2000 replace;&lt;BR /&gt;
	  sheet="sheet1$";&lt;BR /&gt;
	  getname=yes;&lt;BR /&gt;
	run;&lt;BR /&gt;
%end;&lt;BR /&gt;
data whole;&lt;BR /&gt;
  set %do j=1 %to &amp;amp;n;&lt;BR /&gt;
        datafile&amp;amp;j&lt;BR /&gt;
	  %end;&lt;BR /&gt;
	;&lt;BR /&gt;
run;&lt;BR /&gt;
%mend merge;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
The compile will be passed.You will find a Macro(merge) in your Work Library.&lt;BR /&gt;
&lt;BR /&gt;
Second,You need to put the following code in another Edit Window  to run.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
filename lib pipe "dir D:\download\*.xls /b";&lt;BR /&gt;
data file;&lt;BR /&gt;
  length filenames $ 40;&lt;BR /&gt;
  infile lib truncover;&lt;BR /&gt;
  input filenames : $;&lt;BR /&gt;
    filenames="D:\download\"||filenames;&lt;BR /&gt;
run;&lt;BR /&gt;
&lt;BR /&gt;
data _null_;&lt;BR /&gt;
  set file;&lt;BR /&gt;
  call symputx('file'||put(_n_,1.),filenames,'G');&lt;BR /&gt;
run;&lt;BR /&gt;
options sasautos=work;&lt;BR /&gt;
%merge(2)  *assuming the number of xls files is 2;&lt;BR /&gt;
proc print data=whole;&lt;BR /&gt;
run;&lt;BR /&gt;
[/pre]&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
The code is working under SAS 9.0 + Windows XP Home .

Message was edited by: Ksharp</description>
      <pubDate>Mon, 10 May 2010 12:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18356#M3579</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2010-05-10T12:45:54Z</dc:date>
    </item>
    <item>
      <title>Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18357#M3580</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;what do you do if you your path has spaces in it? &lt;/P&gt;&lt;P&gt;for example: filename lib pipe "dir D:\Down Load\*.xls /b";&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thasnk!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 15:48:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18357#M3580</guid>
      <dc:creator>SAShole</dc:creator>
      <dc:date>2012-03-21T15:48:27Z</dc:date>
    </item>
    <item>
      <title>Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18358#M3581</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You can add quote around the path.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;filename lib pipe 'dir "D:\Down Load\*.xls" /b';
data _null_;
 infile lib;
 input;list;
run;

&lt;/PRE&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;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Mar 2012 02:48:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18358#M3581</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-03-22T02:48:28Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18359#M3582</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I want to import and merge more than 1000 excel files in SAS, and all are in the same structure. I tried your codes above, but it could only read the first 9 files. Do you know how to modify it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 12 Jul 2012 21:58:21 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18359#M3582</guid>
      <dc:creator>hilary27</dc:creator>
      <dc:date>2012-07-12T21:58:21Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18360#M3583</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there some log information. ERROR ? WARNING ? .....&lt;/P&gt;&lt;P&gt;Is there some blank or special character in your PATH ?&lt;/P&gt;&lt;P&gt;Do these xls file locate in the same directory or different directory ?&lt;/P&gt;&lt;P&gt;Or you maybe have different type of the same variable when importing these files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 03:24:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18360#M3583</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-07-13T03:24:08Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18361#M3584</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your reply!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There is no blank or special character in the path, and all xls files are located in the same directory for sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I could show you the codes;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* I want to extract the specific rows in Sheet1 for each excel file, and transpose each before merging them together, below is the %macro merge(n) I modified based on your code */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options mprint mlogic symbolgen;&lt;/P&gt;&lt;P&gt;%macro merge(n);&lt;/P&gt;&lt;P&gt;%do i=1 %to &amp;amp;n;&lt;/P&gt;&lt;P&gt;proc import datafile="&amp;amp;&amp;amp;all_files&amp;amp;i" out=one&amp;amp;i dbms=excel replace;&lt;/P&gt;&lt;P&gt;sheet="Sheet1$48:54";&lt;/P&gt;&lt;P&gt;getnames=no;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;proc transpose data=one&amp;amp;i out=two&amp;amp;i;&lt;/P&gt;&lt;P&gt;id F1;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;data whole;&lt;/P&gt;&lt;P&gt;set %do j=1 %to &amp;amp;n;&lt;/P&gt;&lt;P&gt;two&amp;amp;j&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend merge;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* According your codes, data 'file' is made of each excel file's name, but when I ran your code, each cell in the data 'file' is 'C:\Users\WIN7\filename.xls', so I revised the code */&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILENAME excl pipe "dir/b C:\Users\WIN7\*.xls"; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data all_files;&lt;/P&gt;&lt;P&gt;length fl_nm $200 file_name $200;&lt;/P&gt;&lt;P&gt;DROP fl_nm;&lt;/P&gt;&lt;P&gt;infile excl truncover END=last;&lt;/P&gt;&lt;P&gt;input fl_nm;&lt;/P&gt;&lt;P&gt;file_name=scan(fl_nm,1,'.');&lt;/P&gt;&lt;P&gt;IF last=1 THEN call SYMPUT("nfiles",put(_n_,4.));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;nfiles;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile excl;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;list;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data null;&lt;/P&gt;&lt;P&gt;set all_files;&lt;/P&gt;&lt;P&gt;call symputx('all_files'||put(_n_,1.),file_name,'G');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/* When I ran &amp;lt;data null&amp;gt; part, there is an error, but I am pretty sure that my excel filenames contain only allowed character. &lt;/P&gt;&lt;P&gt;ERROR: Symbolic variable name ALL_FILES* must contain only letters, digits, and underscores.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And data 'null' actually is identical with data 'all_files', I want to ask how it should look like?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Finally I ran:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;options sasautos=work;&lt;/P&gt;&lt;P&gt;%merge(2700);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Actually I successfully create data ONE1-ONE9, TWO1-TWO9, but after the first 9 files, there is warning:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(MERGE):&amp;nbsp; %DO loop index variable I is now 10; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 10&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: Apparent symbolic reference ALL_FILES10 not resolved.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 10&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; proc import datafile="&amp;amp;all_files10" out=one10 dbms=excel replace;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; AEXC;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; sheet="Sheet1$48:54";&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; getnames=no;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Unable to open file C:\Users\WIN7\&amp;amp;all_files10.XLS. It does not&amp;nbsp; exist or it is already&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opened exclusively by another user, or you need permission to view its data.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/P&gt;&lt;P&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.23 seconds&lt;/P&gt;&lt;P&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.14 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Could you please look at my codes? There must be some errors but I don't know where it is.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Looking forward your reply!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 05:09:28 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18361#M3584</guid>
      <dc:creator>hilary27</dc:creator>
      <dc:date>2012-07-13T05:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18362#M3585</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Could the problem be the bold "1." below? Suggest you change it to "4." to get numbers greater than 9.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data null;&lt;/P&gt;&lt;P&gt;set all_files;&lt;/P&gt;&lt;P&gt;call symputx('all_files'||put(_n_,&lt;STRONG&gt;1&lt;/STRONG&gt;.),file_name,'G');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 05:22:16 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18362#M3585</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2012-07-13T05:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18363#M3586</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed a problem in your code.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data all_files;&lt;/P&gt;&lt;P&gt;length fl_nm $200 file_name $200;&lt;/P&gt;&lt;P&gt;DROP fl_nm;&lt;/P&gt;&lt;P&gt;infile excl truncover END=last;&lt;/P&gt;&lt;P&gt;input fl_nm &lt;STRONG&gt;$&lt;/STRONG&gt; ;&lt;/P&gt;&lt;P&gt;file_name=scan(fl_nm,1,'.');&lt;/P&gt;&lt;P&gt;IF last=1 THEN call SYMPUT("nfiles",put(_n_,4.));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;fl_nm should be character, so add $ behind it.&lt;/P&gt;&lt;P&gt;and why you use&lt;STRONG&gt; file_name=scan(fl_nm,1,'.');&lt;/STRONG&gt; ?&lt;/P&gt;&lt;P&gt;filen_name should be your full path of xls file&amp;nbsp; Like : C:\Users\WIN7\xxxxx.xls&lt;/P&gt;&lt;P&gt;So change it :&amp;nbsp; filename="C:\Users\WIN7\"||fl_nm;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That might be working.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Ksharp&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 05:39:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18363#M3586</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2012-07-13T05:39:13Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18364#M3587</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;But when I replace "1." with "4.", it turns out that none of files could be read.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Anyway, thanks for your reply!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 14:20:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18364#M3587</guid>
      <dc:creator>hilary27</dc:creator>
      <dc:date>2012-07-13T14:20:54Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18365#M3588</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Ksharp,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I revised my code as you suggested. But it doesn't work, could you help me to look at it?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I really appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;FILENAME excl pipe "dir/b C:\Users\WIN7\*.xls"; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data file;&lt;/P&gt;&lt;P&gt;length fl_nm $200 file_name $200;&lt;/P&gt;&lt;P&gt;DROP fl_nm;&lt;/P&gt;&lt;P&gt;infile excl truncover END=last;&lt;/P&gt;&lt;P&gt;input fl_nm$;&lt;/P&gt;&lt;P&gt;file_name="C:\Users\WIN7\"||fl_nm;&lt;/P&gt;&lt;P&gt;IF last=1 THEN call SYMPUT("nfiles",put(_n_,4.));&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;%put &amp;amp;nfiles;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt;infile excl;&lt;/P&gt;&lt;P&gt;input;&lt;/P&gt;&lt;P&gt;list;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data null;&lt;/P&gt;&lt;P&gt;set file;&lt;/P&gt;&lt;P&gt;call symputx('file'||put(_n_,1.),file_name,'G');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, data 'file' is like "C:\Users\WIN7\xxxxx.xls", but still when I ran the following codes, there is error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;75&amp;nbsp;&amp;nbsp; data null;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;76&amp;nbsp;&amp;nbsp; set file;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;77&amp;nbsp;&amp;nbsp; call symputx('file'||put(_n_,1.),file_name,'G');&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;78&amp;nbsp;&amp;nbsp; run;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Symbolic variable name FILE* must contain only letters, digits, and underscores.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: Argument 1 to function SYMPUTX at line 77 column 6 is invalid.&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;NOTE: There were 2700 observations read from the data set WORK.FILE.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: The data set WORK.NULL may be incomplete.&amp;nbsp; When this step was stopped there were 3182&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 1 variables.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: Data set WORK.NULL was not replaced because this step was stopped.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;NOTE: At least one W.D format was too small for the number to be printed. The decimal may be&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; shifted by the "BEST" format.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What the data 'null' should be look like?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And when I ran %merge(2700), it could still read the first 9 files only.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The successfully reading's log is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(MERGE):&amp;nbsp; %DO loop index variable I is now 9; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 9&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable FILE9 resolves to C:\Users\WIN7\12306BM_10_AM.xls&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 9&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; proc import datafile="C:\Users\WIN7\12306BM_10_AM.xls" out=one9 dbms=excel&lt;/P&gt;&lt;P&gt;replace;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; AEXC;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; sheet="Sheet1$48:54";&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; getnames=no;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable _IMEXSERROR_ resolves to SERROR&lt;/P&gt;&lt;P&gt;NOTE: WORK.ONE9 data set was successfully created.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/P&gt;&lt;P&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.29 seconds&lt;/P&gt;&lt;P&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.15 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 9&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 9&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; proc transpose data=one9 out=two9;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; id F1;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: There were 7 observations read from the data set WORK.ONE9.&lt;/P&gt;&lt;P&gt;NOTE: The data set WORK.TWO9 has 10 observations and 9 variables.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE TRANSPOSE used (Total process time):&lt;/P&gt;&lt;P&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.01 seconds&lt;/P&gt;&lt;P&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.01 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The unsuccessful reading's log is:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;MLOGIC(MERGE):&amp;nbsp; %DO loop index variable I is now 10; loop will iterate again.&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; &amp;amp;&amp;amp; resolves to &amp;amp;.&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 10&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: Apparent symbolic reference FILE10 not resolved.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 10&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; proc import datafile="&amp;amp;file10" out=one10 dbms=excel replace;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; AEXC;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; sheet="Sheet1$48:54";&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; getnames=no;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: Unable to open file C:\Users\WIN7\&amp;amp;file10.XLS. It does not&amp;nbsp; exist or it is already&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; opened exclusively by another user, or you need permission to view its data.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE IMPORT used (Total process time):&lt;/P&gt;&lt;P&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.19 seconds&lt;/P&gt;&lt;P&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.10 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 10&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;ERROR: File WORK.ONE10.DATA does not exist.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;SYMBOLGEN:&amp;nbsp; Macro variable I resolves to 10&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; proc transpose data=one10 out=two10;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; id F1;&lt;/P&gt;&lt;P&gt;MPRINT(MERGE):&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;WARNING: The data set WORK.TWO10 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;WARNING: Data set WORK.TWO10 was not replaced because this step was stopped.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;NOTE: PROCEDURE TRANSPOSE used (Total process time):&lt;/P&gt;&lt;P&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.00 seconds&lt;/P&gt;&lt;P&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.00 seconds&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;Hilary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 14:40:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18365#M3588</guid>
      <dc:creator>hilary27</dc:creator>
      <dc:date>2012-07-13T14:40:35Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18366#M3589</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Hilary,&lt;/P&gt;&lt;P&gt;Do you want to try the code below?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data file;&lt;BR /&gt;length fl_nm $200 file_name $200;&lt;BR /&gt;DROP fl_nm;&lt;BR /&gt;infile excl truncover END=last;&lt;BR /&gt;input fl_nm$;&lt;BR /&gt;file_name="C:\Users\WIN7\"||fl_nm;&lt;BR /&gt;IF last=1 THEN call SYMPUT("nfiles",put(_n_,z4.));&lt;BR /&gt;run;&lt;BR /&gt;%put &amp;amp;nfiles;&lt;BR /&gt;data _null_;&lt;BR /&gt;infile excl;&lt;BR /&gt;input;&lt;BR /&gt;list;&lt;BR /&gt;run;&lt;BR /&gt;data null;&lt;BR /&gt;set file;&lt;BR /&gt;call symputx('file'||put(_n_,z4.),file_name,'G');&lt;BR /&gt;run;&lt;/P&gt;&lt;P&gt;options mprint mlogic symbolgen;&lt;BR /&gt;%macro merge(n);&lt;BR /&gt;%do i=1 %to &amp;amp;n;&lt;BR /&gt;%let i=%sysfunc(putn(&amp;amp;i,z4.));&lt;BR /&gt;proc import datafile="&amp;amp;&amp;amp;all_files&amp;amp;i" out=one&amp;amp;i dbms=excel replace;&lt;BR /&gt;sheet="Sheet1$48:54";&lt;BR /&gt;getnames=no;&lt;BR /&gt;run;&lt;BR /&gt;proc transpose data=one&amp;amp;i out=two&amp;amp;i;&lt;BR /&gt;id F1;&lt;BR /&gt;run;&lt;BR /&gt;%end;&lt;BR /&gt;data whole;&lt;BR /&gt;set %do j=1 %to &amp;amp;n;&lt;BR /&gt;%let j=%sysfunc(putn(&amp;amp;j,z4.));&lt;BR /&gt;two&amp;amp;j&lt;BR /&gt;%end;&lt;BR /&gt;;&lt;BR /&gt;run;&lt;BR /&gt;%mend merge;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 15:18:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18366#M3589</guid>
      <dc:creator>Linlin</dc:creator>
      <dc:date>2012-07-13T15:18:39Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18367#M3590</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Linlin,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Your codes works! All files are read successfully. I really appreciate your help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I am curious to know whether there is a way to make the process more efficient and fast? It took 2+ hours to read through all datafile. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Hilary&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 13 Jul 2012 20:37:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18367#M3590</guid>
      <dc:creator>hilary27</dc:creator>
      <dc:date>2012-07-13T20:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18368#M3591</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Ksharp.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I used your code to import multiple files(52). It works perfectly for 9 files. 10 th onwards it stop recognizing the &amp;amp;. &lt;/P&gt;&lt;P&gt;It gives error -&amp;nbsp; "WARNING: Apparent symbolic reference FILE10 not resolved. "&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;here is the code &lt;/P&gt;&lt;P&gt;options mprint mlogic symbolgen;&lt;/P&gt;&lt;P&gt;%macro merge(n);*n is the number of your xls files;&lt;/P&gt;&lt;P&gt;%do i=1 %to &amp;amp;n;&lt;/P&gt;&lt;P&gt;proc import out=datafile&amp;amp;i datafile="&amp;amp;&amp;amp;file&amp;amp;i"&amp;nbsp; dbms=csv replace;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; *sheet="sheet1$";&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; getnames=yes;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; run;&lt;/P&gt;&lt;P&gt;%end;&lt;/P&gt;&lt;P&gt;data whole;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set %do j=1 %to &amp;amp;n;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; datafile&amp;amp;j&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; %end;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;%mend merge;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;filename lib pipe 'dir "C:\Users\awate_3\Box Sync\Projects\Pharma\DAta\Cam\Binder2013New\*.csv" /b';&lt;/P&gt;&lt;P&gt;data _null_;&lt;/P&gt;&lt;P&gt; infile lib;&lt;/P&gt;&lt;P&gt; input;list;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;data file;&lt;/P&gt;&lt;P&gt;&amp;nbsp; length filenames $ 100;&lt;/P&gt;&lt;P&gt;&amp;nbsp; infile lib truncover;&lt;/P&gt;&lt;P&gt;&amp;nbsp; input filenames : $;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; filenames="C:\Users\awate_3\Box Sync\Projects\Pharma\DAta\Cam\Binder2013New\"||filenames;&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;data null;&lt;/P&gt;&lt;P&gt;&amp;nbsp; set file;&lt;/P&gt;&lt;P&gt;&amp;nbsp; call symputx('file'||put(_n_,1.),filenames,'G');&lt;/P&gt;&lt;P&gt;run;&lt;/P&gt;&lt;P&gt;options sasautos=work;&lt;/P&gt;&lt;P&gt;%merge(52)&amp;nbsp; *assuming the number of xls files is 2;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Aug 2014 20:24:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18368#M3591</guid>
      <dc:creator>buckeyefisher</dc:creator>
      <dc:date>2014-08-23T20:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18369#M3592</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;saskiwi already made the remark you will get a problem at the 10-th value. &lt;/P&gt;&lt;P&gt;The issue is putting a numeric will add blanks or zero-s to get postions filled. An REXX stem or SAS macro array is based on numbers not being adjusted.&lt;BR /&gt;Correct the adjustment to follow sas-macro conventions. I think 10.000 files as limit will do (4 positions). &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;call symputx('file'||&lt;SPAN style="color: #3366ff; font-size: 14pt;"&gt;put(_n_,1.)&lt;/SPAN&gt;,filenames,'G');&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN style="color: #0000ff; font-size: 10pt;"&gt;TRIM(LEFT(PUT(_n_,4.))&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2014 07:06:58 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18369#M3592</guid>
      <dc:creator>jakarman</dc:creator>
      <dc:date>2014-08-24T07:06:58Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18370#M3593</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Jaap has already given you answer:&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;call symputx('file'||put(_n_,&lt;STRONG&gt;8. -L&lt;/STRONG&gt; ),filenames,'G');&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Aug 2014 11:45:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/18370#M3593</guid>
      <dc:creator>Ksharp</dc:creator>
      <dc:date>2014-08-24T11:45:54Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/242221#M55783</link>
      <description>&lt;P&gt;The original code cannot import any .xls files and gives me the following error. All filenames are .xls with only letters, digits, and underscores:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;316&lt;BR /&gt;317 data _null_;&lt;BR /&gt;318 set file;&lt;BR /&gt;319 call symputx('file'||put(_n_,1.),filenames,'G');&lt;BR /&gt;320 run;&lt;/P&gt;&lt;P&gt;ERROR: Symbolic variable name FILE* must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX at line 319 column 6 is invalid.&lt;BR /&gt;filenames=M:\LS\Data\BannerMerge\FilesGrade350_201 _ERROR_=1 _N_=10&lt;BR /&gt;ERROR: Symbolic variable name FILE* must contain only letters, digits, and underscores.&lt;BR /&gt;NOTE: Argument 1 to function SYMPUTX at line 319 column 6 is invalid.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Jan 2016 16:09:03 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/242221#M55783</guid>
      <dc:creator>JakeElwood</dc:creator>
      <dc:date>2016-01-07T16:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: Importing multi Excel files</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/362471#M64553</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;My queries are:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) I have 3 files as "Excel 1" "Excel 2" "Excel 3" and after the import I have all the files but by the name&amp;nbsp;&lt;SPAN&gt; "Excel" "Excel" "Excel". I cant sort it out.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;2) I am new to this type of import. Can you tell me what does &amp;nbsp; &amp;nbsp; 'dir "E:\Analytics\Excel\*.xls" /b' &amp;nbsp; &amp;nbsp;b means in this link. And how to alter this as per our requirement.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 29 May 2017 11:24:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Importing-multi-Excel-files/m-p/362471#M64553</guid>
      <dc:creator>shekharkaul2007</dc:creator>
      <dc:date>2017-05-29T11:24:37Z</dc:date>
    </item>
  </channel>
</rss>

