Mark
Mark

Reputation: 347

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?

Upvotes: 0

Views: 74

Answers (1)

Tom
Tom

Reputation: 51566

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.)

Upvotes: 4

Related Questions