I'm trying to append all the tables(same structure) in the work library into one data set. But I need to have a new column name which can indicate the table name. I tried two methods:
macro array and do over:
PROC APPEND BASE=_dupout DATA=dup_&dataset. FORCE; RUN;
Proc SQL:
PROC SQL; SELECT MEMNAME, catx('.', libname, MEMNAME) INTO : MEMNAMES SEPARATED BY ' ' from dictionary.tables where libname='WORK'; quit; DATA DUP_OUT; SET &MEMNAMES.; RUN;
but neither of those I can find a way add a new column (table name). Maybe it is a very simple question? I'm stuck..please help...