If all of the CSV files have the same structure and are either all of the CSV files in that folder or all that follow a simple pattern then just use a single data step with a wildcard, * , in the filename.
So something like this:
data want;
length fname $256;
infile "\\my directory\*.csv" dsd truncover filename=fname;
input @;
if fname ne lag(fname) then delete;
length firstvar 8 secondvar $40 lastvar 8;
informat lastvar date.;
format lastvar date9.;
input firstvar -- lastvar;
run;
If the files are really large you might need to work harder by keeping track of which files you already read so you know which ones are new, but if the files are not that big then it is probably just easier to read the all each time.
... View more