Thanks everyone! It seems that i haven't describe clearly in details... It's a little bit weird to read reported table in excel into sas dataset... Now i upload ten excel file as a sample (it remains in Chinese characters). The code i wrote is as below: %let my_dir = e:\xls\ ; 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.)); call symput('G'||ck,f_name2); if last then call symput('TOT_FILZ',ck); run; data &dsout ; run; %DO i = 1 %TO &TOT_FILZ; proc import datafile="&&G&i" out=test dbms=excel2000 replace; range='a1:i50'; getnames=no; run; data test1; set test(drop=f1); if f3=. then delete; run; proc transpose data=test(keep=f1 where=(f1 ne ' ')) out=test2(drop=_name_ _label_ col1 ); var f1; run; data test3(drop=col6); set test1; if _n_=1 then set test2; run; data &dsout ; set &dsout test3 ; run; %END ; data &dsout ; set &dsout; if _N_ = 1 then delete; run; %MEND Mult_Fil ; %mult_fil(PIPEin=xcl_fil,DSout=perm); After submitting this program, we could see that COL3 has a format of $106. and a length of 106, so some characters had not been read completely. The strangest thing about it is that if the first two excels (10预防本科卫生统计学(理论).xls, 10预防本科卫生统计学(实验).xls) were deleted from e:\xls, remaining eight excels in it, submitting this program could make COL3 a format of $150. and a length of 150. This makes me puzzled, could anyone explain it and edit my code to make COL3 a format of $200. disregarding how many excels in e:\xls? I appreciate any help you provide!
... View more