%macro import_files(BIO=);
/*1**/
data fichiers (keep=fichiers);
length fichiers $256;
fich=filename('fich',"&BIO.");
/* */
did=dopen('fich');
/* compt */
nb_fich=dnum(did);
do i=1 TO nb_fich;
fichiers=dread(did,i);
output;
end;
/* */
rc=dclose(did);
run;
/*2 */
proc sql;
select SUBSTR(fichiers, 1, INDEX(fichiers, '.') - 1) into :Labo_list separated by ' '
from fichiers;
quit;
%put &Labo_list.; /* log */
/*3 -*/
%do l = 1 %to %sysfunc(countw(&Labo_list.));
%let labo = %scan(&Labo_list., &l.);
%put &labo.;
proc import datafile="&BIO.\&labo." out=Labo&l.
dbms=XLSX replace;
run;
%end;
data BDD_labo;
set
%do i = 1 %to %sysfunc(countw(&Labo_list.));
Labo&i.
%end;
;
run;
%mend;
%import_files(BIO=C:\BIO);