Release 10.1A: OpenEdge Data Management:
Database Administration

> ## Century Year Offset (-yy)

> Operating system and syntax | UNIX Windows | `-yy` `n`
> Use with | Maximum value | Minimum value | Single-user default | Multi-user default
> CS, DBS | – | – | 1950 | 1950

> ``n``

> A four-digit year (1990, for example). The default is 1950.

> Use Century Year Offset (`-yy`) to determine the start of the 100-year period in which a date with a two-digit year is valid.

> Some OpenEdge applications reserve only two-digits for the year in the date format. When, for example, `-yy` is set at 1950, the server determines if the two-digit year value is greater or less than 50. If the year is greater than 50, the server assumes that the date is in the twentieth century. If the year is less than 50, the server assumes that the date is in the twenty-first century.

> Table 18–10 shows examples.

> Table 18–10: Century setting and date format
> -yy | Year (as supplied in DATE format) | Result of year function
> --- | --- | ---
> 1900 | 50 to 99 | 1950 to 1999
> 00 to 49 | 1900 to 1949
> 1950 | 50 to 99 | 1950 to 1999
> 00 to 49 | 2000 to 2049
> 1980 | 80 to 99 | 1980 to 1999
> 00 to 79 | 2000 to 2079

> Notice that all two-digit year values expand into the 100-year period beginning with `-yy`.

> To test the effect of `-yy`, start the database with a different `-yy` value and run the following procedure:

>     DEFINE VARIABLE ddate AS DATE.
>     DISPLAY "Enter date or Press F4 to end." WITH FRAME msg.
>     REPEAT:
>       SET ddate LABEL "Date" WITH SIDE-LABELS.
>       DISPLAY YEAR(ddate) FORMAT "9999" LABEL "=> Year"
>       WITH SIDE-LABELS.
>     END.

> Note: If you use a hard-coded date containing a two-digit year in a `.p` file, the OpenEdge RDBMS honors the `-yy` parameter and expands the two-digit year to a four-digit year during compilation. However, this might not match the run time `-yy`. To prevent this problem, use four digit years for hard-coded dates in programs.

> This startup parameter provides the same functionality as the `SESSION:YEAR-OFFSET` attribute.

Copyright © 2005 Progress Software Corporation www.progress.com Voice: (781) 280-4000 Fax: (781) 280-4095