the idea is this, I need the macro to change my data and set as the days months and year. i have 44 dataset are called like this: Acr_maestro_mes_ant_20150131 Acr_maestro_mes_ant_20150331 Acr_maestro_mes_ant_20150430 ..................................................... Acr_maestro_mes_ant_20160931 Acr_maestro_mes_ant_20161030 I need the macro to change the date i would not have to create such a long consultation. I did the following: %MACRO COSECHA; %LET DIA = ; %DO año = 15 %TO 16; %DO MES = 01 %TO 12; %IF ("&MES" = 01 OR "&MES" = 03 or "&MES" = 05 OR "&MES" =07 OR "&MES" = 08 OR "&MES" = 09 OR "&MES" = 12) %THEN "&DIA" = 31; %IF ("&MES" = 04 OR "&MES" = 06 or "&MES" = 10 OR "&MES" =11) %THEN "&DIA" = 30; data prueba.Acr_maestro_"$MES$AÑO"; set prueba.Acr_maestro_mes_ant_"&AÑO&MES&DIA"; where LLAMADA= 1; keep ID LLAMADA SOLICITUD FECHA; %END; I`m sure that something is missing in the query, this is the first time that i work with macros in SAS, if you can help me i would appreciate. Sorry for my bad english.
... View more