Hello, Please use beow code to resolve your query in most efficient way: data out1; set_date = '12dec2011'd; set_date_last_1mth = intnx('month',set_date,-1,'s'); set_date_last_2mth = intnx('month',set_date,-2,'s'); format set_date set_date_last_1mth set_date_last_2mth ddmmyy10.; run; I hope it helps. Thanks.
... View more