I found a sample program on the SAS website to import all .csv files from a directory here: https://documentation.sas.com/?docsetId=mcrolref&docsetTarget=n0ctmldxf23ixtn1kqsoh5bsgmg8.htm&docsetVersion=9.4&locale=en I am trying to import several csv files using this macro. The only thing I've changed is the filepath reference when the macro is invoked at the end of the code and I get an error message saying "WARNING: Apparent symbolic reference CSV not resolved." I thought that inputting csv just told the macro what file extension is used for all the files in the folder. I know this warning message is usually the result of trying to use a global variable that has never been defined. I didn't think I was referencing a variable named "CSV." Does anyone know why I might be getting this error? Thanks! %macro drive(dir,ext);
%local cnt filrf rc did memcnt name;
%let cnt=0;
%let filrf=mydir;
%let rc=%sysfunc(filename(filrf,&dir));
%let did=%sysfunc(dopen(&filrf));
%if &did ne 0 %then %do;
%let memcnt=%sysfunc(dnum(&did));
%do i=1 %to &memcnt;
%let name=%qscan(%qsysfunc(dread(&did,&i)),-1,.);
%if %qupcase(%qsysfunc(dread(&did,&i))) ne %qupcase(&name) %then %do;
%if %superq(ext) = %superq(&name) %then %do;
%let cnt=%eval(&cnt+1);
%put %qsysfunc(dread(&did,&i));
proc import datafile="&dir\%qsysfunc(dread(&did,&i))" out=dsn&cnt
dbms=csv replace;
run;
%end;
%end;
%end;
%end;
%else %put &dir cannot be open.;
%let rc=%sysfunc(dclose(&did));
%mend drive;
%drive(c:\temp,csv)
... View more