Question 1) To be honest, I have seen many implementations of macro lists and such like in over 15years, and there is one consistent thing I have found, they never make code more user friendly or modifiable. First there is rarely any documentation to adequately explain the code or parameters, and secondly due to that, those paramter lists can cause fails and bugs of all kinds in the code. For instance a simple step where the name in the list doesn't exist, will you check for this before your code, what about not containing the expected variables, or the right type, correct values etc. The list goes on.
Question 2) Data merging (joining) is the means of putting data across the page, based on joining variables. Setting data is the method of setting data one under the other.
Finally if you want to make your code more robust, put your data into a set library, then you can apply a list to get all of them without knowing up front:
data temp.compiled enrollids(keep=enrollid);
set raw.ccaes:;
where dx1 in ('123', '12345') and age >= 18;
run;
This will take all datasets in raw with ccaes prefix.
... View more