I am trying to get an output that has counts of multiple tables from different libraries. For Example: Table descriptions: Library name = a table name = table_1 month ID January2021 123 January2021 456 February2021 123 February2021 456 February2021 789 Library name = b table name = table_2 month ID January2021 456 January2021 789 January2021 741 February2021 111 February2021 654 I am able to get the counts for one table each in a macro as following: %macro qa_counts(table_name=, month=, count_id=) proc sql; select &month, count(&count_id) as counts from &table_name group by &month order by &month desc; quit; %mend qa_counts; %qa_counts(table_name = a.table_1, month = month, count_id = ID) %qa_counts(table_name = b.table_2, month = month, count_id = ID) But I am looking for an output with the counts of both the tables in a single table output along with the table names, like this: table_name month count_ID a.table_1 January 2 a.table_1 February 3 b.table_2 January 3 b.table_2 February 2 Can someone please help?
... View more