YEARWINDOW

Use YEARWINDOW to specify the first year of the 100-year window (the century window) to be applied to windowed date field processing by the COBOL compiler.

YEARWINDOW option syntax

Read syntax diagramSkip visual syntax diagramYEARWINDOW( base-year)

Default is: YEARWINDOW(1900)

Abbreviations are: YW

base-year represents the first year of the 100-year window. You must specify it with one of the following values:

  • An unsigned decimal integer between 1900 and 1999.

    An unsigned integer specifies the starting year of a fixed window. For example, YEARWINDOW(1930) indicates the century window 1930-2029.

  • A negative integer from -1 through -99.

    A negative integer indicates a sliding window. The first year of the window is calculated by adding the negative integer to the current year. For example, YEARWINDOW(-80) indicates that the first year of the century window is 80 years before the year in which the program is run.

Usage notes

  • The YEARWINDOW option has no effect unless the DATEPROC option is also in effect.
  • At run time, two conditions must be true:
    • The century window must have its beginning year in the 1900s.
    • The current year must lie within the century window for the compilation unit.

    For example, if the current year is 2010, the DATEPROC option is in effect, and you use the YEARWINDOW(1900) option, the program will terminate with an error message.