Beginning of the next calendar year
This is the recommended expression for rounding dates to the beginning of the next calendar year:
BOY1_DT:= 12 #MONTHROUND (A_DT + 1) &
; add one day to every date to take advantage of coincident or following 1/1
A_DT may be either a single date (e.g., 7/16/2015, DOH, #DODEC) or an array of dates (e.g., #DATE).
Why are we adding 1 day to A_DT before we round the date(s)? Because 12 #MONTHROUND rounds to the coincident or following beginning of calendar year. By adding 1 day, 1/1/2020 becomes 1/2/2020, and 12 #MONTHROUND 1/2/2020 returns 1/1/2021, the beginning of the next calendar year. If A_DT is 12/31/2020, then adding 1 day gives us 1/1/2021, which is the beginning of the next calendar year, so 12 #MONTHROUND 1/1/2021 returns 1/1/2021 (i.e., coincident or following), the beginning of the next calendar year for 12/31/2020.
If you want to be consistent with the beginning of the next plan year methodology, then we recommend this expression:
BOY1_DT:= #NEXTBEGMTH (1 #LSTBUSDAY A_DT) &
; find the last business day of the current calendar year, then round that last business day
; (i.e., 12/29, 12/30, or 12/31) to the beginning of the next month (i.e., 1/1)
We start with #LSTBUSDAY because it's the easiest way to work with plan years but can be generalized to calendar years. Then we use #NEXTBEGMTH to guarantee that we are at the beginning of the next calendar year. 1 #LSTBUSDAY A_DT finds the last business day of the current calendar year, which is either 12/31, 12/30, or 12/29 of the current calendar year, depending on whether the last day of the current calendar year is a weekday, Sunday or Saturday. Then, #NEXTBEGMTH converts it to the first day of the next month (i.e., the first day of the next calendar year).
If you have already have calculated the end of the current calendar year for each date in A_DT (e.g., stored in EOY_DT), then simply adding 1 day gives you the beginning of the next calendar year:
BOY1_DT:= EOY_DT + 1 &