Hello, I have one table which is a fixed table has 4 columns, ID, date, hour, product, the table name as Product and I have another 10 tables, which has more columns, ID, date, hour, product, category, subcategory, region. And the 10 tables name as YEAR2021_WW01, YEAR2021_WW02, YEAR2021_WW03...YEAR2020_WW02. I would like these 10 tables (YEAR2021_WW01...) inner join with Product on a.id=b.id and a.date=b.date and a.hour=b.hour. and i want to keep all the columns from table a, and one column "product" from table PODUCT, then output the 10 tables with the same table name(YEAR2021_WW01, YEAR2021_WW02, YEAR2021_WW03...YEAR2020_WW02). I write a proc sql just for joining one table, proc sql; create table YEAR2021_WW01 as select a*, b.Product from YEAR2021_WW01 a inner join PRODUCT b on (a.id=b.id and a.date=b.date and a.hour=b.hour) quit; How to write a macro to join the 10 tables at once? PRODUCT ID DATE HOUR PRODUCT 1001 01JAN2021 8 CAMBRIDGE 1002 15JAN2021 16 SUMMERSET YEAR2021_WW01 ID DATE HOUR STATUS MOOD REGION CATEGORY SUBCATEGORY 1001 01JAN2021 8 NORMAL TRUE PARIS A AA 1002 15JAN2021 16 NORMAL TRUE PARIS B BB
... View more