$VERIFY-DATE with no TEMPLATE returns an INVALID DATE when using a year greater than 2013 for the date.

Document ID : KB000049088
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

Programs that use $VERIFY-DATE with no TEMPLATE will result with an INVALID DATE if the year is greater than 2012.

Solution:

When a TEMPLATE is not specified in a program that is using $VERIFY-DATE, the default, which is 'YYMMDD" will be used and will return an INVALID DATE if the year is greater than 2012. For example, a date of 20130101 would give back an INVALID DATE because 13 is not a valid month. You must use a TEMPLATE, for example:

IF $VERIFY-DATE('20131208') will return an INVALID DATE.
IF $VERIFY-DATE('20130812',TEMPLATE='YEARDDMM') will return a VALID DATE.