SQL - Scalar functions - ADD_YEARS
The ADD_YEARS function returns a datetime value that represents the first argument plus a specified number of years.
The schema is SYSIBM.
The result of the function is a timestamp with the same precision as expression, if expression is a timestamp. Otherwise, the result of the function is a date. If any argument can be null, the result can be null; if any argument is null, the result is the null value.
If the result would be February 29 of a non-leap-year, the day is changed to 28, and a warning indicator in the SQLCA is set to indicate the adjustment.
SET :ADD_YEAR = ADD_YEARS(CURRENT_DATE, 1)
SET :ADD_YEAR = ADD_YEARS(:DATE,3)
SET :DATEHV = DATE('2008-2-29') + 4 YEARS SET :DATEHV = ADD_YEARS('2008-2-29', 4)
SET :DATEHV = DATE('2008-2-29') + 3 YEARS SET :DATEHV = ADD_YEARS('2008-2-29', 3)
SET :ADD_YEAR = ADD_YEARS(:DATE,-3)