Ok.
I post another code I wrote before.
[pre]
%let subdir=D:\sasdata\peter\patrick\;
filename dir pipe "dir &subdir.*.csv /B";
data new;
infile dir truncover end=last;
input filename $100.;
filename=cats("&subdir",filename);
call symputx(cats('path',_n_),filename);
call symputx(cats('dsn',_n_),scan(scan(filename,5,'\'),1,'.'));
if last then call symputx('nobs',_n_);
run;
%put _user_;
%macro import;
%do i=1 %to &nobs;
data WORK.&&dsn&i; ;
%let _EFIERR_ = 0; /* set the ERROR detection macro variable */
infile "&&path&i" delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 ;
informat VAR1 best32. ;
informat VAR2 $30. ;
informat VAR3 comma30. ;
informat VAR4 comma30.;
informat VAR5 comma30.;
informat VAR6 comma30.;
informat VAR7 comma30.;
informat VAR8 comma30.;
informat VAR9 best12.;
format VAR1 best12. ;
format VAR2 $30. ;
format VAR3 best32.2 ;
format VAR4 best32.2;
format VAR5 best32.2;
format VAR6 best32.2;
format VAR7 best32.2;
format VAR8 best32.2;
format VAR9 best12. ;
input
VAR1
VAR2
VAR3
VAR4
VAR5
VAR6
VAR7
VAR8
VAR9
;
if _ERROR_ then call symputx('_EFIERR_',1); /* set ERROR detection macro variable */
run;
%end;
%mend import;
%import
[/pre]
About wildcard,If you want every dataset which name start with 'makedata',then use dir c:\makedata* command,it will return the names makedata1 makedata2 ......
Ksharp