Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


Date field

A date field can be any of the following:

The term date field refers to both expanded date fields and windowed date fields.

Windowed date field

A windowed date field is a date field that contains a windowed year. A windowed year consists of two digits, representing a year within the century window.

Expanded date field

An expanded date field is a date field that contains an expanded year. An expanded year consists of four digits.

The main use of expanded date fields is to provide correct results when these are used in combination with windowed date fields; for example, where migration to four-digit year dates is not complete. If all the dates in an application use four-digit years, there is no need to use the millennium language extensions.

Year-last date field

A year-last date field is a date field whose DATE FORMAT clause specifies one or more Xs preceding the YY or YYYY. Year-last date fields are supported in a limited number of operations, typically involving another date with the same (year-last) date format, or a nondate.

Date format

Date format refers to the date pattern of a date field, specified either:

Compatible date field

The meaning of the term compatible, when applied to date fields, depends on the COBOL division in which the date field occurs:

Data division
Two date fields are compatible if they have identical USAGE and meet at least one of the following conditions:

A windowed date field can be subordinate to an expanded date group data item. The two date fields are compatible if the subordinate date field has USAGE DISPLAY, starts 2 bytes after the start of the group expanded date field, and the two fields meet at least one of the following conditions:

Procedure division
Two date fields are compatible if they have the same date format except for the year part, which can be windowed or expanded. For example, a windowed date field with DATE FORMAT YYXXX is compatible with:

Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)