VALIDDATE returns a '1'B if the string d holds a date/time value that matches the pattern p.
>>-VALIDDATE-(-d--+-----------+-)------------------------------>< '-,p-+----+-' '-,w-'
d specifies the input date as a character string representing date/time according to the pattern p.
d must have computational type and should have character type. If not, d is converted to character.
If present, it specifies the date/time pattern of d. If p is missing, it is assumed to be the default date/time pattern of 'YYYYMMDDHHMISS999'.
p must have computational type and should have character type. If not, it is converted to character.
Allowable patterns are listed in Table 2. For an explanation of Lilian format, see Date/time built-in functions.
If the pattern contains punctuation characters, VALIDDATE checks that the input string contains matching characters. For example, for the pattern YYYY-MM-DD, VALIDDATE accepts 2008-03-14 but not 2008.03.14.
dcl duedate char(8);
dcl (b1,b2) bit(1);
duedate = '19950228';
b1 = validdate( duedate, 'YYYYMMDD' ); /* b1 = '1'b */
duedate = '02301995';
b2 = validdate( duedate, 'DDMMYYYY' ); /* b2 = '0'b */