Here's what I see in SAS. Can someone help me with equivalent sql code of it please!
Indicator of how runout is handled cs_runout: 1 = extend from plan year end date, 2 = extend from termination, 3 = extend from date of claim, 4 = no runout 5 = Extend from grace period end;
IF cs_runout = 1 THEN DO;
IF days = 15 THEN DO;
IF ms_end=INTNX("MONTH",ms_end,0,"END") THEN runout=INTNX('MONTH',ms_end,runout_period,'END')+15;
%*If ms_end is last day of month then move to last day of future month then add 15;
ELSE runout=INTNX('MONTH',ms_end,runout_period,'SAMEDAY')+15;
%*If ms_end is NOT last day of month then move to SAMEDAY of future month then add 15;
put "Values in runout: " mb_subid= ms_end= runout_period= days= runout=;
END;
ELSE DO;
IF ms_end=INTNX("MONTH",ms_end,0,"END") THEN runout=INTNX('MONTH',ms_end,runout_period,'END');
%*If ms_end is last day of month then move to last day of future month;
ELSE runout=INTNX('MONTH',ms_end,runout_period,'SAMEDAY');
%*If ms_end is NOT last day of month then move to SAMEDAY of future month;
put "Values in runout: " mb_subid= ms_end= runout_period= days= runout=;
END;
*** ???? ***;
END;
Editted: ** I tried to convert what you posted into something that looks like SAS code. **
... View more