Thank you for you response. Below is the modified code, 90% issues you mentioned is acutally due to modified sample code from Original code. Logic: I have different set of file name patterns so I am trying to use if statements to modify libname to accomadate the changes based on the each file_name pattern. I have a problem in defining libname in IF statement, please let me know if there are any other way to do it. Issue: Libname is not assgined. %let Filename_1 = FILE1,FILE2;
%let SAS_DATASET = DATA1,DATA2;
%macro file_process;
%let word_cnt = %sysfunc(countW(%bquote(&Filename_1), %str(,)));
%put NOTE: &=word_cnt;
%do i = 1 %to &word_cnt;
%let file_name=%scan("&Filename_1",&i, ",");
%let dataset=%scan("&SAS_DATASET",&i, ",");
%IF &file_name=File1 %Then libname xlsFile XLSX "/usr/2016 log &file_name.xlsm";
%IF &file_name=File2 %Then libname xlsFile XLSX "/usr1/2016 log &file_name final.xlsm";
%end;
%mend file_process;
... View more