Hi, I am trying to read in selected tabs from a excel file and append them into one dataset. I have created a macro variable called TabList where the values are quoted strings with spaces in them (e.g. "aaa bbb","bbb ccc"...) as this is how the sheets are named. I am having trouble passing the list in macro. I am getting the following error with the code below: ERROR: A character operand was found in the %EVAL function or %IF condition where a numeric operand is required. Thank you for your help! proc sql; select Tab into :TabList separated by "," from mapping; quit; %macro process; %let n=%sysfunc(countw("&TabList.", ',' )); %put &n; %do i=1 %to &n; %let val = %scan(&TabList.,&i); %put &val &i &n; OPTION VALIDVARNAME=V7; PROC IMPORT DATAFILE= &in_dir. OUT= data DBMS=XLSX REPLACE; SHEET= &val; GETNAMES=NO; datarow=3; RUN; %end; %mend; %process;
... View more