Please, when you get errors show us the LOG along with the entire code of a data step or procedure and all notes, messages or errors. Because SAS often places diagnostic characters in the log, copy the log and paste into a code box opened on the forum with the </> icon.
Since you are running this code in a macro you will need to set OPTIONS MPRINT; prior to running the macro to create a meaningful log.
From long experience anything that relies on Proc Import is subject to frequent breakage because the data sets created are not consistent. This is aggravated when the data starts in XLS or other spreadsheets as the default behavior of proc import only uses a very few rows to set variable properties.
Your CODE is importing XLS files. You attached CSV. They are not the same. You might be better off to create CSV files and then use data steps to read them as the results are much more consistent, assuming the columns don't change types or order between source files.
... View more