COBOL - Opções de compilação - YEARWINDOW


Volta a página anterior

Volta ao Menu Principal


Desenvolvido por DORNELLES Carlos Alberto - Analista de Sistemas - Brasília DF. - cad_cobol@hotmail.com

Opções de compilação - 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

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 number between 1900 and 1999.

    This specifies the starting year of a fixed window.
    For example, YEARWINDOW(1930) indicates a century window of 1930-2029.
  • A negative integer from -1 through -99.

    This 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 at the time 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 2007, the DATEPROC option is in effect, and you use the YEARWINDOW(1900) option, the program will terminate with an error message.

© Copyright IBM Corp.