DAY-TO-YYYYDDD
The DAY-TO-YYYYDDD function converts argument-1 from a date with a two-digit year (YYnnn) to a date with a four-digit year (YYYYnnn). 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.
- argument-1
- Must be zero or a positive integer less than 99367.
The COBOL run time does not verify that the value is a valid date.
- 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.
Some examples of returned values from the DAY-TO-YYYYDDD function follow:
Current year | argument-1 value | argument-2 value | Returned value |
---|---|---|---|
2002 | 10004 | -20 | 1910004 |
2002 | 10004 | -120 | 1810004 |
2002 | 10004 | 20 | 2010004 |
2013 | 95005 | -10 | 1995005 |