I have a list of directories in the form of work.Directories.data, let's say (variable is directory). Each row contains a string that looks like this:
C:\importantfolder\subfolder\
I want to find the contents of each of these directories and combine them to make a new dataset. Here is what I have so far:
%macro ScanDirec(STRING=);
filename temptree pipe 'dir "&STRING" /s /b' lrecl=5000;
data SmallList;
infile temptree truncover;
input dirlist $char1000.;
run;
data BigList;
set BigList SmallList;
run;
%mend ScanDirec;
data SmallList;
run;
data BigList;
run;
data _null_;
set Directories;
call execute('%ScanDirectories('||directory||')');
run;
I get some serious problems, but I think my code looks pretty harmless. What is the issue?