Hi Bob,
There are some useful file functions which you can use within a datastep. The following example reads only XLS files from a certain place. Cheers Peter
DATA save.input_files (KEEP = filename filepath id);
LENGTH filename filepath $256;
rc=FILENAME("readdir","&filepath");
did=DOPEN("readdir");
memcount=DNUM(did);
DO i = 1 TO memcount;
filename = DREAD(did,i);
IF UPCASE(scan(filename,-1,".")) = "XLS" THEN
DO;
filepath = "&filepath\" !! TRIM(LEFT(filename));
id = i;
output;
END;
END;
rc=DCLOSE(did);
RUN;
... View more