There might be times when you want COBOL data items to be treated as date fields only under certain conditions or only in specific parts of the program. Or your application might contain two-digit-year date fields that cannot be declared as windowed date fields because of some interaction with another software product.
For example, if a date field is used in a context where it is recognized only by its true binary contents without further interpretation, the date in that field cannot be windowed. Such date fields include:
Conversely, there might be times when you want a date field to be treated as a nondate in specific parts of the program.
COBOL provides two intrinsic functions to deal with these conditions:
related tasks
Using DATEVAL
Using UNDATE