Dear experts, I am using the following macro that I found online to import all the xls contained in a folder: options validvarname=any; %let subdir=G:\xxxxxxt\; filename dir pipe "dir &subdir.*.xls /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,6,'\'),1,'.')); if last then call symputx('nobs',_n_); run; %put _user_; %macro import; %do i=1 %to &nobs; proc import datafile="&&path&i" out=&&dsn&i dbms=excel replace; getnames=yes; mixed=yes; run; %end; %mend import; %import But I get the error message in the attached picture. Readin some post on the topic I assume that the problem is related to the variable NOBS... why the symbolic reference is not resolved. How should I debug it? Thank in adcance, SH.
... View more