把xls改成csv试试,看看这个http://blog.csdn.net/yugao1986/article/details/7036902:
options pageno=1 ;
options mprint ;
%let my_dir = d:\temp\ ;
filename xcl_fil pipe "dir &my_dir.*.xls /b";
%MACRO Mult_Fil(PIPEin=,DSout=);
%LOCAL i ;
data _NULL_ ;
infile &PIPEin end=last;
retain k 0 ;
k + 1 ;
length f_name1 f_name2 $ 60 ;
input f_name1 $ ;
f_name2 = "&my_dir"||trim(left(f_name1));
ck = compress(put(k,3.));
* This will produce both the filename ;
* and the path/filename ;
call symput('F'||ck,trim(left(f_name1)));
call symput('G'||ck,f_name2);
* Now, a count of the number of files ;
if last then call symput('TOT_FILZ',ck);
run;
* Create Dataset with Dummy Record ;
data &dsout ;
run;
%DO i = 1 %TO &TOT_FILZ;
proc import datafile="&&G&i" out=__test
dbms=excel2000 replace;
getnames=yes ;
data __test ;
set __test;
* Save the name of the file this ;
* data came from ;
file = "&&F&i";
data &dsout ;
* Stack the files ;
set &dsout __test ;
%END ;
data &dsout ;
set &dsout;
* remove Dummy Record ;
if _N_ = 1 then delete;
run;
%MEND Mult_Fil ;
%mult_fil(PIPEin=xcl_fil,DSout=perm)
proc print data=&syslast;
title "Reading All Files";
run;
Hadoop|
Apache Pig|
Apache Kafka|
Apache Storm|
Impala|
Zookeeper|
SAS|
TensorFlow|
人工智能基础|
Apache Kylin|
Openstack|
Flink|
MapReduce|
大数据|
云计算|
用户登录
还没有账号?立即注册
用户注册
投稿取消
文章分类: |
|
还能输入300字
上传中....