IBM Support

New base year support for 2-digit year date formats

News


Abstract

The current supported date range for 2-digit year date formats is January 1, 1940 – December 31, 2039. When using a date format that only includes the last two digits of a year, the system assumes years 40 to 99 are 1940 - 1999, and years 00 to 39 are 2000 - 2039.
In IBM i 7.5, limited support has been added for a new base year of 1970, with a date range of January 1, 1970 – December 31, 2069.

Content

A new environment variable named QIBM_QBASEYEAR can be used beginning in 7.5 to set the base year to 1940 or 1970. When the environment variable is not present, the current default of 1940 will continue to be used for the base year in release 7.5. This base year will be used by commands with a parameter of TYPE(*DATE) to determine the century when only the last two digits of the year are provided.
The QIBM_QBASEYEAR environment variable will not affect RPG, COBOL or database. Dates stored in databases or used by an application program should not rely on the operating system to determine the century. Applications should be updated to use a date format with a 3 or 4-digit year, such as *CYMD, *YYMD, *LONGJUL, etc. before the year 2040 to avoid wrapping back to 1940 (similar to the year 2000 problem).
Instructions to set the base year:

To set the base year to 1970 for all jobs in the system:

ADDENVVAR ENVVAR(QIBM_QBASEYEAR) VALUE(1970) LEVEL(*SYS)

(Only jobs started after the environment variable is added will have the environment variable set – use WRKENVVAR or DSPJOB, opt 22 to see if the environment variable is set for a job).

To set the base year to 1970 in your own job:

ADDENVVAR ENVVAR(QIBM_QBASEYEAR) VALUE(1970) LEVEL(*JOB) REPLACE(*YES)

The base year is set when the job is started and cached in the job, therefore you must call the following command to update the cached base year after adding or changing the job level environment variable:
CHGJOB JOB(*) DATFMT(*MDY)

(Change the date format to the same date format currently used by your job.)

[{"Type":"MASTER","Line of Business":{"code":"LOB57","label":"Power"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"ARM Category":[{"code":"a8m0z0000000CHAAA2","label":"Operating System"}],"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.5.0"}]

Document Information

Modified date:
03 May 2022

UID

ibm16579221