<?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 FILES in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/16002#M2207</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;ok. found the problem. SAS can only import and export 255 variable when you access excel 2007 files. is it possible that i modify the code, so that SAS read 255 variables in once at a time and then merge them all together in the end?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks. BR&amp;nbsp; Dingdang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 24 Oct 2013 14:21:30 GMT</pubDate>
    <dc:creator>Dingdang</dc:creator>
    <dc:date>2013-10-24T14:21:30Z</dc:date>
    <item>
      <title>IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15984#M2189</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
I have about 10 excel files with the same column heading and i need a way to import all off them in one table (appending one after another). I can write a proc import statement for each one followed by a proc append statement but how would i do it all together? Thanks</description>
      <pubDate>Tue, 12 Oct 2010 10:51:05 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15984#M2189</guid>
      <dc:creator>sasbegginer</dc:creator>
      <dc:date>2010-10-12T10:51:05Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15985#M2190</link>
      <description>Well, as you described:&lt;BR /&gt;
&lt;BR /&gt;
PROC IMPORT ....&lt;BR /&gt;
&lt;BR /&gt;
PROC APPEND&lt;BR /&gt;
&lt;BR /&gt;
PROC IMPORT ....&lt;BR /&gt;
&lt;BR /&gt;
PROC APPEND&lt;BR /&gt;
 etc.&lt;BR /&gt;
&lt;BR /&gt;
If you want to save some programming line you could wrap it into a macro.&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Tue, 12 Oct 2010 11:25:47 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15985#M2190</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2010-10-12T11:25:47Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15986#M2191</link>
      <description>Yes but any help writing a macro which doesnt require the file name and imports all the files in a folder...</description>
      <pubDate>Tue, 12 Oct 2010 11:35:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15986#M2191</guid>
      <dc:creator>sasbegginer</dc:creator>
      <dc:date>2010-10-12T11:35:00Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15987#M2192</link>
      <description>See this as strictly for inspiration, totally untested. See on-.line doc for references.&lt;BR /&gt;
&lt;BR /&gt;
%macro importAll(DIR = );&lt;BR /&gt;
&lt;BR /&gt;
%let rc = %sysfunc(filename(dir,&amp;amp;DIR));&lt;BR /&gt;
%let did = %sysfunc(dopen(dir));&lt;BR /&gt;
%let nfiles = %sysfunc(dnum(did));&lt;BR /&gt;
&lt;BR /&gt;
%do I = 1 to &amp;amp;NFILES;&lt;BR /&gt;
&lt;BR /&gt;
	%let ExcelFile = %sysfunv(dread(did,&amp;amp;I));&lt;BR /&gt;
&lt;BR /&gt;
	proc import file="&amp;amp;DIR\&amp;amp;ExcelFile." out=ExcelData. ...;&lt;BR /&gt;
	...&lt;BR /&gt;
	run;&lt;BR /&gt;
&lt;BR /&gt;
	proc append base=AllData data=ExcelData;&lt;BR /&gt;
	run;&lt;BR /&gt;
&lt;BR /&gt;
%end;&lt;BR /&gt;
&lt;BR /&gt;
%let rc = %sysfunc(dclose(did));&lt;BR /&gt;
%let rc = %sysfunc(filename(dir));&lt;BR /&gt;
&lt;BR /&gt;
%mend importAll;&lt;BR /&gt;
&lt;BR /&gt;
%importAll(dir=C:\data\MyExcelFiles);&lt;BR /&gt;
&lt;BR /&gt;
/Linus</description>
      <pubDate>Tue, 12 Oct 2010 11:58:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15987#M2192</guid>
      <dc:creator>LinusH</dc:creator>
      <dc:date>2010-10-12T11:58:08Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15988#M2193</link>
      <description>You can try this example too.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
  %macro w2sas05(input=d:\dep\input\plast\2009\w4_2,out=work.plast);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
 /* read files in directory */&lt;BR /&gt;
 %let dir=%str(%'dir %")&amp;amp;input.%str(\%" /A-D/B/ON%');&lt;BR /&gt;
 filename myfiles pipe %unquote(&amp;amp;dir);&lt;BR /&gt;
 data list1; length fname $256.;&lt;BR /&gt;
 infile myfiles truncover;&lt;BR /&gt;
 input myfiles $100.;&lt;BR /&gt;
 /* put _infile_;*/&lt;BR /&gt;
 fname=quote(upcase(cats("&amp;amp;input",'\',myfiles)));&lt;BR /&gt;
 drop myfiles;&lt;BR /&gt;
 run;&lt;BR /&gt;
 filename myfiles clear;&lt;BR /&gt;
&lt;BR /&gt;
 %let j=1;&lt;BR /&gt;
 %let dsid=%sysfunc(open(list1));&lt;BR /&gt;
 %let rc=%sysfunc(fetch(&amp;amp;dsid));&lt;BR /&gt;
  %do %while(&amp;amp;rc=0);&lt;BR /&gt;
    %let file=%sysfunc(getvarc(&amp;amp;dsid,%sysfunc(varnum(&amp;amp;dsid,fname))));&lt;BR /&gt;
    &lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  PROC IMPORT DBMS=EXCEL2002 OUT= _&amp;amp;j&lt;BR /&gt;
            DATAFILE= &amp;amp;file  REPLACE ;&lt;BR /&gt;
     GETNAMES=YES;&lt;BR /&gt;
     SCANTEXT=YES;&lt;BR /&gt;
     USEDATE=YES;&lt;BR /&gt;
     SCANTIME=YES;&lt;BR /&gt;
     DBSASLABEL=NONE;&lt;BR /&gt;
     TEXTSIZE=100;&lt;BR /&gt;
  RUN;&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
  proc append data=_&amp;amp;j base=&amp;amp;out; run;&lt;BR /&gt;
&lt;BR /&gt;
  proc delete data=_&amp;amp;j; run;&lt;BR /&gt;
&lt;BR /&gt;
  %let rc=%sysfunc(fetch(&amp;amp;dsid));&lt;BR /&gt;
  %let j=%eval(&amp;amp;j+1);&lt;BR /&gt;
  %end;&lt;BR /&gt;
  %let rc=%sysfunc(close(&amp;amp;dsid));&lt;BR /&gt;
&lt;BR /&gt;
 %mend w2sas05;&lt;BR /&gt;
&lt;BR /&gt;
[/pre]

Message was edited by: Oleg_L</description>
      <pubDate>Tue, 12 Oct 2010 12:41:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15988#M2193</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2010-10-12T12:41:30Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15989#M2194</link>
      <description>Any way of using data step infile option FILENAME= and *.xls as the file to collect the file names without reading through the whole file?&lt;BR /&gt;
Then the file names become available for a call execute invocation of PROC import for each workbook. &lt;BR /&gt;
just an interesting thought.   ....</description>
      <pubDate>Wed, 13 Oct 2010 08:08:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15989#M2194</guid>
      <dc:creator>Peter_C</dc:creator>
      <dc:date>2010-10-13T08:08:40Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15990#M2195</link>
      <description>Oleg,&lt;BR /&gt;
&lt;BR /&gt;
Great macro.  &lt;BR /&gt;
&lt;BR /&gt;
It works fine in native SAS 9.2 but I get the following error messages when running it on Enterprise Guide 4.3:&lt;BR /&gt;
&lt;BR /&gt;
ERROR: Insufficient authorization to access PIPE.&lt;BR /&gt;
ERROR: Error in the FILENAME statement.&lt;BR /&gt;
&lt;BR /&gt;
Any idea anyone what I can do to make it work in Enterprise Guide?  Here is the modified macro code I am using:&lt;BR /&gt;
&lt;BR /&gt;
%macro w2sas05(input=c:\Data\SAStests\ScrapTies\, out=work.DailyTemp);&lt;BR /&gt;
* read files in directory ;&lt;BR /&gt;
%let dir=%str(%'dir %")&amp;amp;input.%str(\%" /A-D/B/ON%'); &lt;BR /&gt;
filename myfiles pipe %unquote(&amp;amp;dir);&lt;BR /&gt;
data list1;&lt;BR /&gt;
length fname $256.; &lt;BR /&gt;
infile myfiles truncover; &lt;BR /&gt;
input myfiles $100.;             &lt;BR /&gt;
* put _infile_;&lt;BR /&gt;
fname=quote(upcase(cats("&amp;amp;input",'\',myfiles))); &lt;BR /&gt;
drop myfiles;&lt;BR /&gt;
run; &lt;BR /&gt;
filename myfiles clear; &lt;BR /&gt;
%let j=1; &lt;BR /&gt;
%let dsid=%sysfunc(open(list1)); &lt;BR /&gt;
%let rc=%sysfunc(fetch(&amp;amp;dsid));  &lt;BR /&gt;
	%do %while(&amp;amp;rc=0);    &lt;BR /&gt;
		%let file=%sysfunc(getvarc(&amp;amp;dsid,%sysfunc(varnum(&amp;amp;dsid,fname))));&lt;BR /&gt;
&lt;BR /&gt;
		PROC IMPORT DBMS=EXCEL OUT= _&amp;amp;j&lt;BR /&gt;
					DATAFILE= &amp;amp;file  REPLACE ;&lt;BR /&gt;
		SHEET="summary";&lt;BR /&gt;
		GETNAMES=YES;&lt;BR /&gt;
		SCANTEXT=YES;&lt;BR /&gt;
		USEDATE=NO;&lt;BR /&gt;
		SCANTIME=NO;&lt;BR /&gt;
		DBSASLABEL=NONE;&lt;BR /&gt;
		TEXTSIZE=100;&lt;BR /&gt;
		RUN;&lt;BR /&gt;
proc append force data=_&amp;amp;j base=&amp;amp;out;&lt;BR /&gt;
run;&lt;BR /&gt;
proc delete data=_&amp;amp;j;&lt;BR /&gt;
run;&lt;BR /&gt;
data &amp;amp;out;&lt;BR /&gt;
 set &amp;amp;out;&lt;BR /&gt;
 run;&lt;BR /&gt;
%let rc=%sysfunc(fetch(&amp;amp;dsid));&lt;BR /&gt;
%let j=%eval(&amp;amp;j+1);&lt;BR /&gt;
%end;&lt;BR /&gt;
%let rc=%sysfunc(close(&amp;amp;dsid));&lt;BR /&gt;
%mend w2sas05;&lt;BR /&gt;
&lt;BR /&gt;
%w2sas05;</description>
      <pubDate>Thu, 17 Feb 2011 18:07:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15990#M2195</guid>
      <dc:creator>HamidK</dc:creator>
      <dc:date>2011-02-17T18:07:24Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15991#M2196</link>
      <description>Your macro executes an operating system DIR command to get a list of files. By default this ability to execute an operating system command is turned off in EG. A change to your SAS server options would be required, for example I suspect XCMD = OFF.</description>
      <pubDate>Thu, 17 Feb 2011 20:52:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15991#M2196</guid>
      <dc:creator>SASKiwi</dc:creator>
      <dc:date>2011-02-17T20:52:30Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15992#M2197</link>
      <description>SASkiwi,&lt;BR /&gt;
&lt;BR /&gt;
How can I change the server options in EG?  I did not find anything under &amp;gt;Tools&amp;gt;Options.&lt;BR /&gt;
&lt;BR /&gt;
Thanks.</description>
      <pubDate>Thu, 17 Feb 2011 21:03:37 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15992#M2197</guid>
      <dc:creator>HamidK</dc:creator>
      <dc:date>2011-02-17T21:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15993#M2198</link>
      <description>This option is defined in the server-metadata and be altered by your sas-administrators only.</description>
      <pubDate>Fri, 18 Feb 2011 08:06:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15993#M2198</guid>
      <dc:creator>andreas_lds</dc:creator>
      <dc:date>2011-02-18T08:06:52Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15994#M2199</link>
      <description>Greetings!&lt;BR /&gt;
&lt;BR /&gt;
May be this version of macro will work on your default EG settings.&lt;BR /&gt;
I can not test it in EG. I don't have it.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
  %macro cfin(cfindir=d:\data\2011\sks\,out=work.plast);&lt;BR /&gt;
&lt;BR /&gt;
  %let filrf=mydir;&lt;BR /&gt;
  %let rc=%sysfunc(filename(filrf,"&amp;amp;cfindir"));&lt;BR /&gt;
  %let did=%sysfunc(dopen(&amp;amp;filrf));&lt;BR /&gt;
  %let lstname=;&lt;BR /&gt;
  %let memcount=%sysfunc(dnum(&amp;amp;did));&lt;BR /&gt;
  %if &amp;amp;memcount &amp;gt; 0 %then %do;&lt;BR /&gt;
  %do i=1 %to &amp;amp;memcount;&lt;BR /&gt;
  %let lstname=%sysfunc(dread(&amp;amp;did,&amp;amp;i));&lt;BR /&gt;
  %let file=&amp;amp;cfindir.&amp;amp;lstname;&lt;BR /&gt;
  PROC IMPORT DBMS=EXCEL2002 OUT= _&amp;amp;i&lt;BR /&gt;
            DATAFILE= "&amp;amp;file" REPLACE ;&lt;BR /&gt;
     RANGE='PRV_RATE$A1:F65536';&lt;BR /&gt;
     GETNAMES=YES;&lt;BR /&gt;
     SCANTEXT=YES;&lt;BR /&gt;
     USEDATE=YES;&lt;BR /&gt;
     SCANTIME=YES;&lt;BR /&gt;
     DBSASLABEL=NONE;&lt;BR /&gt;
     TEXTSIZE=100;&lt;BR /&gt;
  RUN;&lt;BR /&gt;
  proc append data=_&amp;amp;i base=&amp;amp;out; run;&lt;BR /&gt;
  proc delete data=_&amp;amp;i; run;&lt;BR /&gt;
  %end;&lt;BR /&gt;
  %let rc=%sysfunc(dclose(&amp;amp;did));&lt;BR /&gt;
  %end;&lt;BR /&gt;
  %mend cfin;&lt;BR /&gt;
&lt;BR /&gt;
   options mprint=1;&lt;BR /&gt;
   %cfin(cfindir=d:\data\2011\sks\,out=work.plast);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Fri, 18 Feb 2011 12:01:24 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15994#M2199</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-02-18T12:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15995#M2200</link>
      <description>Andreas,&lt;BR /&gt;
&lt;BR /&gt;
Thank you for your response.  However, I am have SAS and EG installed on my standalone computer.  I found references to changing the settings re. XCMD in another thread:&lt;BR /&gt;
&lt;BR /&gt;
&lt;A href="http://support.sas.com/forums/thread.jspa?messageID=28370" target="_blank"&gt;http://support.sas.com/forums/thread.jspa?messageID=28370&lt;/A&gt; &lt;BR /&gt;
&lt;BR /&gt;
I will figure out how to change my PC settings - I don't have admin rights to it!</description>
      <pubDate>Fri, 18 Feb 2011 14:09:38 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15995#M2200</guid>
      <dc:creator>HamidK</dc:creator>
      <dc:date>2011-02-18T14:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15996#M2201</link>
      <description>Oleg,&lt;BR /&gt;
&lt;BR /&gt;
Thank you.  This works.  I will use it for now until I get the XCMD enabled on my SAS configuration.&lt;BR /&gt;
&lt;BR /&gt;
Regards,&lt;BR /&gt;
Hamid.</description>
      <pubDate>Fri, 18 Feb 2011 14:10:54 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15996#M2201</guid>
      <dc:creator>HamidK</dc:creator>
      <dc:date>2011-02-18T14:10:54Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15997#M2202</link>
      <description>Peter,&lt;BR /&gt;
your interesting thought is working.&lt;BR /&gt;
Thank you for the idea.&lt;BR /&gt;
&lt;BR /&gt;
[pre]&lt;BR /&gt;
&lt;BR /&gt;
  %macro sks2sas01(input=d:\work\test1,out=work.tt);&lt;BR /&gt;
 /* read files in directory */&lt;BR /&gt;
 %let dir=%str(%'dir %")&amp;amp;input.%str(\%" /A-D/B/ON%');&lt;BR /&gt;
 filename myfiles pipe %unquote(&amp;amp;dir);&lt;BR /&gt;
 data list1; length fname $256.;&lt;BR /&gt;
 infile myfiles truncover;&lt;BR /&gt;
 input myfiles $100.;&lt;BR /&gt;
 /* put _infile_;*/&lt;BR /&gt;
 fname=quote(upcase(cats("&amp;amp;input",'\',myfiles)));&lt;BR /&gt;
 out="&amp;amp;out";&lt;BR /&gt;
 drop myfiles;&lt;BR /&gt;
 call execute('&lt;BR /&gt;
  PROC IMPORT DBMS=EXCEL2002 OUT= _1&lt;BR /&gt;
            DATAFILE= '||fname||' REPLACE ;&lt;BR /&gt;
     RANGE="PRV_RATE$A1:F65536";&lt;BR /&gt;
     GETNAMES=YES;&lt;BR /&gt;
     SCANTEXT=YES;&lt;BR /&gt;
     USEDATE=YES;&lt;BR /&gt;
     SCANTIME=YES;&lt;BR /&gt;
     DBSASLABEL=NONE;&lt;BR /&gt;
     TEXTSIZE=100;&lt;BR /&gt;
  RUN;&lt;BR /&gt;
  proc append data=_1 base='||out||' force; run;&lt;BR /&gt;
  proc delete data=_1; run;&lt;BR /&gt;
 ');&lt;BR /&gt;
 run;&lt;BR /&gt;
 filename myfiles clear;&lt;BR /&gt;
&lt;BR /&gt;
 %mend sks2sas01;&lt;BR /&gt;
&lt;BR /&gt;
 %sks2sas01(input=d:\work\test1,out=work.tt);&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
[/pre]</description>
      <pubDate>Mon, 21 Feb 2011 13:45:39 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15997#M2202</guid>
      <dc:creator>Oleg_L</dc:creator>
      <dc:date>2011-02-21T13:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15998#M2203</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;hi Oleg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;your code looks great but í've got a small problem running it (since i am an absolute beginner in sas, i dont really fully understand your code as to say where my problem is). i have a file with 10 test data tables and there is only one table in each of them, containing the variables a b c d...n and each variable has 30 random values.&amp;nbsp; I suppose RANGE gives the area where the data should be read, so i adjusted my code to 'RANGE="table1$A1:N30"' otherweise i didnt change any part of the code. and then i ran it and got the following warning message:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;WARNING: Variable a was not found on BASE file. The variable will not be added to the BASE file.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;and this for every variable a to n. As a result contains work.tt no columns. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;why did this happen and how should i adjust my code so it works?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;Many thanks again!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-size: 8pt;"&gt;BR&amp;nbsp; Dingdang&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 13:59:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15998#M2203</guid>
      <dc:creator>Dingdang</dc:creator>
      <dc:date>2013-09-26T13:59:18Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15999#M2204</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;HI Oleg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;problem solved as i changed RANGE to SHEET. but many thanks anyway &lt;img id="smileyhappy" class="emoticon emoticon-smileyhappy" src="https://communities.sas.com/i/smilies/16x16_smiley-happy.png" alt="Smiley Happy" title="Smiley Happy" /&gt; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&amp;nbsp; Dingdang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 15:02:27 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/15999#M2204</guid>
      <dc:creator>Dingdang</dc:creator>
      <dc:date>2013-09-26T15:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/16000#M2205</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The %For macro has examples of importing multiple Excel spreadsheets, see the last example at&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A class="jive-link-external-small" href="http://www.sascommunity.org/wiki/Streamlining_Data-Driven_SAS_With_The_%25FOR_Macro"&gt;http://www.sascommunity.org/wiki/Streamlining_Data-Driven_SAS_With_The_%25FOR_Macro&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 26 Sep 2013 15:29:35 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/16000#M2205</guid>
      <dc:creator>PaigeMiller</dc:creator>
      <dc:date>2013-09-26T15:29:35Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/16001#M2206</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Oleg,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;i used your code on another file. the excelsheets that i want to read into SAS have about 5000 variables and each of them have only 1 Observation. You code worked great but only 255 Variables were read into SAS, and each of them had then 8 observations (only the first one was originally in my excelsheets and the other 7 are just empty ones). why did this happen? how can i correct it so that all the variables could be correclty read into SAS?&lt;/P&gt;&lt;P&gt;thanks again for your super help!!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;BR&amp;nbsp; Dingdang &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 14:09:40 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/16001#M2206</guid>
      <dc:creator>Dingdang</dc:creator>
      <dc:date>2013-10-24T14:09:40Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/16002#M2207</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;BR /&gt;ok. found the problem. SAS can only import and export 255 variable when you access excel 2007 files. is it possible that i modify the code, so that SAS read 255 variables in once at a time and then merge them all together in the end?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Many thanks. BR&amp;nbsp; Dingdang&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 14:21:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/16002#M2207</guid>
      <dc:creator>Dingdang</dc:creator>
      <dc:date>2013-10-24T14:21:30Z</dc:date>
    </item>
    <item>
      <title>Re: IMPORT MULTIPLE EXCEL FILES</title>
      <link>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/16003#M2208</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A __default_attr="821120" __jive_macro_name="user" class="jive_macro jive_macro_user" data-objecttype="3" href="https://communities.sas.com/"&gt;&lt;/A&gt;: You really ought to create a new discussion rather than just ask a new question as a reply to an old discussion.&amp;nbsp; In that new discussion you really ought to describe your problem better, specifically to show the code you are using.&amp;nbsp; SAS can read all columns from an Excel 2007 workbook.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Oct 2013 14:39:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/IMPORT-MULTIPLE-EXCEL-FILES/m-p/16003#M2208</guid>
      <dc:creator>art297</dc:creator>
      <dc:date>2013-10-24T14:39:30Z</dc:date>
    </item>
  </channel>
</rss>

