Dear everyone,
Thank you in advanced for your time.
Why do I get the mistake in the code ? Outside the macro it works.
fecha_list = 201812 201901;
%macro AllFechasScore(mes_proceso_list);
%LOCAL i fecha fecha_1m_anterior fecha_2m_anterior;
%let i=1;
%DO %WHILE (%SCAN(&mes_proceso_list., &i., ' ') ne );
%let fecha = %SCAN(&mes_proceso_list., &i., ' ');
/*Creating fecha_1m_anterior*/
data _null_;
call symput ('fecha_1m_anterior',
1*put(intnx('month',mdy( mod(&fecha.,100),1,int(&fecha./100) ) ,-1),yymmn6.)
);
run;
/*Creating fecha_2m_anterior*/
data _null_;
call symput ('fecha_2m_anterior',
1*put(intnx('month',mdy( mod(&fecha_1m_anterior.,100),1,int(&fecha_1m_anterior./100) ) ,-1),yymmn6.)
);
run;
/* Printings in log*/
%put num_iter = &i.;
%put fecha hoy = &fecha.;
%put fecha 1 mes anterior = &fecha_1m_anterior.;
%put fecha 2 mes anterior = &fecha_2m_anterior.;
%end;
%let i = %eval(&i + 1);
%mend;
%AllFechasScore(&fecha_list.);
... View more