@sghatak wrote:
Thank you , i could figure out the issues. Corrected code:-
options mprint symbolgen; %macro monthelig; %let CYm1=0; %let i=1; %do %while (&i <7); data test; set test_0; %if E_START_DATE&i<='01APR2018'd<=E_END_DATE&i and &CYm1=0 %then %do; CYm1=1; %end; %else %if E_START_DATE&i not in ('') and &CYm1=1 %then %do; CYm1=1; %END; %else %if E_START_DATE&i in ('') and &CYm1=1 %then %do; CYm1=1; %END; %else %if E_START_DATE&i in ('') and &CYm1=0 %then %do; CYm1=0; %end; run; %let i=%sysevalf(&i+1); %put i=&i; %end; %mend monthelig; %monthelig;
This won't work either, for the reasons @Astounding already gave. You need to understand what the macro PREprocessor does before you start using it.
... View more