Hi antonbcristina, Thank You so much for such a quick response and in detail where novice like me can understand. This code seems giving what I am looking for if I run today. What If I am running tomorrow? The 20th day will become 21st Day (21st-April 2023). My requirement is anytime, the month and year should change but day should be 20th. So , say if I run your code tomorrow or until end of April, it should still gives me 20th April 2023. Vice versa if I am running same code on any of day of May 2024, it should give me 20th May 2023. (so 12 months but day should remain same). Hope I am able to explain. I am going to use this as macro within my sas code which compare the data and flag y/n. is ther a way to hard code the day as 20th and pass that value and rest of your snippet of macro remain same. I am also meanwhile go through the document which you have provided here. Regards, MSree
... View more