1 / 1

End of Month Macro

End of Month Macro. /*Use when something should run only on the last day of the month*/ data _null_; call symput('now',PUT(today(),DATE9.)); /*today*/ run; data _null_; nextbeg = intnx('month',"&now"D,+1); /*beginning of next month*/ endofmo = nextbeg - 1; /*last day of current month*/

netis
Download Presentation

End of Month Macro

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. End of Month Macro /*Use when something should run only on the last day of the month*/ data _null_; call symput('now',PUT(today(),DATE9.)); /*today*/ run; data _null_; nextbeg = intnx('month',"&now"D,+1); /*beginning of next month*/ endofmo = nextbeg - 1; /*last day of current month*/ call symput('endofmo',PUT(endofmo,DATE9.)); run; %put &now; %put &endofmo; %macro tagmo; %if &now eq &endofmo %then %do; /*Check if today is last day of month*/ /*Code that needs to be run on the last day of the month*/ %end; %mend tagmo; %tagmo;

More Related