My situation is I have several different tables that were produced from a macro function that I now want to bring together into one table. The number of tables (lets call the number i) can vary depending on what is run through the program. Lets say my i tables are ZZZ&i and each one has a column result&i, I want to make one dataset where if ZZZ&i exists then result&i is added as a column. I've tried solving this with a %DO loop in PROC SQL but it doesn't seem to accept my code unless the loop is outside my "CREATE TABLE" statement. An example of a successful output would be tables ZZZ1, ZZZ3, and ZZZ4 exist and one final table is created with variables result1, result3, and result4 each from their respective origins. Thanks in advance for any help!
... View more