Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


YEAR-TO-YYYY

The YEAR-TO-YYYY function converts argument-1, a two-digit year, to a four-digit year. argument-2, when added to the year at the time of execution, defines the ending year of a 100-year interval, or sliding century window, into which the year of argument-1 falls.

The function type is integer.

If the DATEPROC compiler option is in effect, then the returned value is an expanded date field with implicit DATE FORMAT YYYY.

Format
Read syntax diagramSkip visual syntax diagram>>-FUNCTION YEAR-TO-YYYY--(--argument-1--+------------+--)-----><
                                         '-argument-2-'     
 
argument-1
Must be a non-negative integer that is less than 100.
argument-2
Must be an integer. If argument-2 is omitted, the function is evaluated assuming the value 50 was specified.

The sum of the year at the time of execution and the value of argument-2 must be less than 10,000 and greater than 1,699.

Examples of return values from the YEAR-TO-YYYY function are shown in the following table.

Current year argument-1 value argument-2 value Returned value
1995 4  23 2004
1995 4 -15 1904
2008 98 23 1998
2008 98 -15 1898

Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)