Hi SuperUser Thank you very much for your reply, Yes excel is not ideal for working with, but I had thought it might be easier if I used the PROC IMPORT instead of saving each of the sheets as .csv Taking a look at your code, I copied and pasted and ran it, in the libname each of the sheets has $ suffixed to the name and the spaces in sheet names still remain. The Files that I need to import all have different file names but they have the key word 'case' or 'control' somewhere in the filename. Thankfully the sheet names have remained consistent: 'Whole Blood', 'Blood DNA', 'Serum', 'Plasma'. It is the first two sheets which are causing me difficulty as they have the spaces in their name. If these did not contain spaces I would be able to use the macro parameter sheet as the dataset name and this would have worked, so the specific problem might be with the part of code below? *I ran this code of yours and had the issue of $; libname xls excel 'V:\x\x\Volume cases.xls'; proc copy in=xls out=work; run; ********** data t(KEEP=MEMNAME SUF);
set sashelp.vtable;
where libname = 'XLS';
SUF=compress(memname,'','p');
run;
%LET SUF= ;
DATA _NULL_ ;
set t ;
suffix=put(_n_,4.);
CALL SYMPUT(cats('SUF',suffix), SUF);
run;
... View more