The worksheet name (which is &dat passed as parameter) has spaces in them. I used compress function in the data step to compress the spaces.But it doesnt seem to work and throws an error ,because sas will not support spaces in the dataset name.
any work around for this?
%macro import_caremark(dat);
PROC IMPORT OUT= &dat
DATAFILE= "&inpt.\MPB 2009 08 revised.xls"
DBMS=EXCEL REPLACE;
range"&dat$A3:M32";
GETNAMES=YES;
MIXED=yes;
SCANTEXT=YES;
USEDATE=no;
SCANTIME=YES;
RUN;
data %sysfunc(compress(&dat));
set %sysfunc(compress(&dat));
file_date=put(intnx('month',date(),-1),YYMMD7.);
run;
%mend;
%import_caremark(MPB Sales Report August09);