Skip to main content

Have you thought about changing the CENTURY.PIVOT?


We've had some customers attempting to report date bugs as we approach 2030 which are in fact not a bug at all but just a misunderstanding of the CENTURY.PIVOT setting.

The century pivot point is the year used to determine the century when an ICONV is done on an external date that only provides a 2-digit year.


I have attached a results spreadsheet to this post, so that you can review the different results of setting CENTURY.PIVOT against a 2-digit year ICONV and then seeing the result using an OCONV with a 4-digit year.

You can check the century pivot point with the CENTURY.PIVOT command at ECL.
>CENTURY.PIVOT
Century pivot date is 1930

You can change the century pivot point for your current session with the CENTURY.PIVOT command, or change it for everyone by changing it in system wide configuration file. (udtconfig for UniData and uvconfig for UniVerse )

From the UniData Help

The CENTURY.PIVOT ECL command overrides the system-wide century pivot date defined in the udtconfig file.
Syntax

CENTURY.PIVOT (4-digit year| nn)

Parameter   Description
4-digit year  The 4-digit year defining the century pivot date.
nn                 The century pivot date code, indicating that the next nn years are in the next century.

You can change this value in one of the following ways:

Enter a 4-digit year. UniData interprets the first 2 digits as the century, and the last 2 digits as the year. The last 2 digits of the year you enter, though 99, are considered to be in the century you specify. 0, through the year you entered -1, are considered to be in the next century. For example, if the century pivot date is 1950, years 50 through 99 are in the 1900's, and years 0 through 49 are in the 2000's. If the century pivot date is 2000, 0 through 99 are in the 2000's.

Enter a code in the form of nn, indicating that the next nn years are in the next century. UniData calculates the century pivot date as:
current_year - (100 - nn)

For example, if the current year is 2000 and the century pivot code is 50, the century pivot date is 1950 (2000 - (100 - 50)).

If you enter CENTURY.PIVOT with no options, UniData returns the current setting for the century pivot date.



------------------------------
Jonathan Smith
UniData ATS
Rocket Support
------------------------------