filename indata pipe 'dir D:\sasdata\mydir /b';
data file_list;
length fname $50.;
infile indata truncover; /* infile statement for file names */
input fname $50.; /* read the file names from the directory */
call symput ('num_files',_n_); /* store the record number in a macro variable */
run;
把路径文件名字换掉就可以了。数据集合里面就是文件名字。