我要把一个文件夹中许多个比如.txt或.dbf文件合并读入到一个SAS文件中,
问题是若是有1千个上市公司的文件,文件名只是代码不同,当然这些代码不完全可以采用循环读取,因为怕有的代码是不存在的,如何写SAS程序读取这么多文件是比较快捷方便?
谢谢各位能够帮助一下。

|
楼主: hippocrene
|
3492
4
[求助]如何读取多个外部文件? |
|
本科生 53%
-
|
回帖推荐SignPingGu 发表于2楼 查看完整内容 You can first get the list of the directory and assign it to a macro variable. Then, you can use loops to read it.The following code put the list of file into dataset - myfile.%macro cr_dir(_mydir_, OUT =); %local rc myref; %let rc = %sysfunc( filename( myRef, . )); %let myRef = _%substr( &myRef, 2 ); ...
本帖被以下文库推荐
| ||
|
|
| ||
| ||
加好友,备注cda京ICP备16021002号-2 京B2-20170662号
京公网安备 11010802022788号
论坛法律顾问:王进律师
知识产权保护声明
免责及隐私声明


