Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

EOM Variable using sysfunc?

I have the below code which gets the first day of the month in YYYYMMDD format. But I need to adjust to End of Month.

%let CLNA_EOM = %sysfunc(intnx(month,&sysfunc(date()),-1),yymmddn8.);

I tried adding ,’E’ after the -1 but that doesn’t work.

%let CLNA_EOM =%sysfunc(intnx(month,&sysfunc(date()),-1,'E'),yymmddn8.);

Thoughts?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

To the macro processor everything is a string, so there is no need to add quotes around literal strings.

The INTNX() function does not understand the value ‘E’ that you gave it. Use either E or END. Just like you used MONTH instead of ‘MONTH’ when telling INTNX() what type of interval to use.

%let CLNA_EOM =%sysfunc(intnx(month,&sysfunc(date()),-1,E),yymmddn8.)
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading