I am trying to import multiple Excel files that are in a folder on the PC Files Server into EG 4.3.
I have used the libname and data step before to import just one file; however I am not sure how to tweak this to make it work for multiple files especially since the file names and # of files could be different every time.
I have also used the infile statement with the *.* option in a data step before to import multiple files, but the files were already on the SAS server.
we are doing this with macros, similar to the code below:
if did GT 0 then do;
if memcount gt 0 then do i=1 to memcount;
/* subsetting the list */
if substr(upcase(Filename),1,3)='BLA' and INDEX(upcase(Filename) ,'.XLS') then output;
%put Files to read: &numcopyf;
%if &numcopyf gt 0 %then %do;
%do i=1 %to &numcopyf;
if _N_=&i then do;
In the %readinexcelfile macro you'll have to put your code for importing the data.
we are using server based SAS with Win 64. Are you using IWA and the folder is on a different server than the workspace server? Because I just found out that that can result in problems. Does [pre] libname test "C:\PathToMyFiles"; [/pre] work for you in EG?
IWA stands for Integrated Windows Authentication, meaning that you're using eg. smartcard's for authentification...
Well if EG can't find/read the folder you're trying to read files from than I guess you're having some sort of security restrictions in place. You'll need to resolve that first, PCFILES will only come afterwards...