Hi guys, I'm creating a query to append Datasets using a macro, because, sometimes i need to append data only from 3 months ago. This code below works well until i create a data set inside of the macro to append the tables: %GLOBAL YEARDT ANO MES INTERVALO ANOI MESI BASES; %LET YEARDT = %SYSFUNC(DATE(),YYMMP10.); %LET ANO = %SUBSTR(&YEARDT.,1,4); %LET MES = %SUBSTR(&YEARDT.,6,2); %PUT &ANO&MES.; %MACRO APPEND(NUM); %DO I = 1 %TO # %LET INTERVALO = %SYSFUNC(PUTN(%SYSFUNC(INTNX(MONTH,%SYSFUNC(DATE()),-&&I.)),YYMMP10.)); %LET ANOI = %SUBSTR(&INTERVALO.,1,4); %LET MESI = %SUBSTR(&INTERVALO.,6,2); %LET BASES = BASE_WO.BASE_WO_&ANOI&MESI.; %PUT &BASES.; %END; %MEND; %APPEND(2); In the %APPEND(2); i'd like to append how much months i need(Type a number). My tables names has dates at the end of their names in this format = 201501; How can i do that to append tables ? Thank you before anything, Rodrigo Dartibali Elias
... View more