代码:
x 'd:\test\abc.txt /s >directory.dir';
data directory;
infile 'directory.dir';
input xxxxxxxxx;
run;作者: shiyiming 时间: 2008-4-7 12:18 标题: Re: 请教:如何读入多个文件夹下的所有指定文件? 你可以 environment variable stores all the paths
eg.
set DIR_PATH = D:\test\abc.txt;C:\temp\abc.txt;
Then,
After called up SAS, get back the environment variable DIR_PATH as macro variable
data _null_;
path=sysget('DIR_PATH');
call symput('FILE_PATH',path);
run;
Then marco variable &FILE_PATH stores all paths you needed.
You can just use function SCAN() to get every path delimited by ';'作者: shiyiming 时间: 2008-4-7 17:50 标题: Re: 请教:如何读入多个文件夹下的所有指定文件? Add the statement below in your pgm.
options noxwait;作者: shiyiming 时间: 2008-4-17 19:23 标题: Re: 请教:如何读入多个文件夹下的所有指定文件? hi
[code:3d1snsqx]filename f_list pipe "dir D:\matlabtestdata\test080413 /b";
data mylist;
infile f_list;
input file :$14.;
put file;
run;