Hi! I did a code to list every folder in a certain path and I sorted them (befor this step) and the folder I'm interested in are in the table "Filenames1593_epuree", witch I called at the end of the macro bellow. It contains 25 folder names. /*****List of all the folders to open****/ /*****determine the number of different name in the table*****/ %macro ouvrir(table); data _null_; set &table. end=eof; if eof then call symput('nomdossier',_n_); run; /*****for every non empty line, attribute a memname into the 'dossier' variable************/ %do i=1 %to &nomdossier; data _null_; set &table.(where=(numero=&i.)); call symput('dossier',memname); run; %put &dossier; %end; %mend ouvrir; %ouvrir(Filenames1593_epuree); This macro up here works well. The problem is when I want to use these folder names to open them and get to every file inside of it. I did this bellow and it works well if I test it with a specific folder instead of &dossier. But, when I do it with a variable in de %let statement, I get nothing... (see log message after the code). What am I doing wrong? Thank you very much!! %let rep=\\sdlc000-000010\soutien$\Projets\ORN - STL-0108\Acquisitions\1593\&dossier.; filename profileA "&rep."; data fichiers_profileA; length name $55; drop rc did i; did=dopen("profileA"); if did > 0 then do; do i=1 to dnum(did); name=dread(did,i); if findw(name, 'profileA.csv')>0 then output; end; rc=dclose(did); end; else put 'Could not open directory'; run; log message 2764 %let rep=\\sdlc000-000010\soutien$\Projets\ORN - STL-0108\Acquisitions\1593\&dossier.; WARNING: Apparent symbolic reference DOSSIER not resolved. 2765 2766 filename profileA "&rep."; WARNING: Apparent symbolic reference DOSSIER not resolved. 2767 2768 data fichiers_profileA; 2769 length name $55; 2770 drop rc did i; 2771 did=dopen("profileA"); 2772 if did > 0 then do; 2773 do i=1 to dnum(did); 2774 name=dread(did,i); 2775 if findw(name, 'profileA.csv')>0 then output; 2776 end; 2777 rc=dclose(did); 2778 end; 2779 else put 'Could not open directory'; 2780 run; Could not open directory NOTE: The data set WORK.FICHIERS_PROFILEA has 0 observations and 1 variables. NOTE: DATA statement used (Total process time): real time 0.01 seconds cpu time 0.01 seconds
... View more