+-------------------------------IBM Extension--------------------------------+
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.
The length of the returned value is 1 byte.
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, neither argument-3 nor argument-4 can be specified.
For a list of valid literals see the SPECIAL-NAMES FORMAT clause.
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.
Argument-4 must follow these rules:
Related Information
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.