I need to join some tables and create a new column with some mark to indicate the table that data came from.
I have tbl_202101, tbl_202102 ... tbl_202109. I need to join all, adding a new column table_origin, for example, indicating the respective table.
DATA FINAL_TABLE;
SET TBL_202101 - TBL_202109;
/* Here I don't know how to identify the current table */
table_origin = CASE
WHEN *CURRENT TABLE* = TBL_202101 THEN 202101
WHEN *CURRENT TABLE* = TBL_202102 THEN 202102
AND GO ON...
RUN;
How could I do it?