The TEST-DATE-TIME function takes a date, time, or timestamp item; alphanumeric item; numeric packed or zoned item; and determines if it is a valid date, time or timestamp. It returns true (B'1') if it is a valid item or false (B'0') if it is not a valid item.
The function type is boolean.
Format >>-FUNCTION TEST-DATE-TIME--------------------------------------> >--(--argument-1--+--------------------------------------------+--)->< '-argument-2--+----------------------------+-' '-argument-3--+------------+-' '-argument-4-'
If argument-1 is a date, time, or timestamp item, then argument-2 through argument-4 are optional. If argument-1 is not a date, time, or timestamp item, argument-2 must be specified (argument-3 and argument-4 are optional).
Argument-1 is tested to see if it is a valid item, based on its type or on argument-2 through argument-4.
If argument-2 is TIMESTAMP, argument-3 can only be specified with FORMAT OF special register,
and argument-4 cannot be specified. 
If argument-3 is the keyword LOCALE, then the format of the date or time is based on a LOCALE. If argument-4 is not specified, the current locale is used, otherwise the locale associated with the mnemonic-name or the LOCALE OF special register is used.
If argument-3 is not specified, the format used for
the test is the one defined in the SPECIAL-NAMES FORMAT clause.
For TIMESTAMP, if argument-3 is not specified, the default format of @Y-%m-%d-%H%M%S.@Sm is used. 