IBM Extension
IBM Extension
DATE-TO-YYYYMMDD
The DATE-TO-YYYYMMDD function converts argument-1 from the form YYnnnn to the form YYYYnnnn. Argument-2, when added to the year at the time of execution, defines the ending year of a 100-year interval, or sliding window, into which the year of argument-1 falls.
The type of the function is integer.
Format >>-FUNCTION DATE-TO-YYYYMMDD------------------------------------> >--(--argument-1--+------------+--)---------------------------->< '-argument-2-'
- argument-1
- Must be a positive integer less than 1000000.
- argument-2
- Must be an integer. If argument-2 is omitted, the function will be evaluated with a value of 50 for argument-2. At the time of execution, the sum of the year with argument-2 will be less than 10000, and greater than 1699.
The equivalent arithmetic expression is:
(FUNCTION YEAR-TO-YYYY (YY, argument-2) * 10000 + nnnn)
where
YY = (argument-1/10000) truncated to an integer value
nnnn = argument-1 modulus 10000
This function supports a sliding window algorithm. See YEAR-TO-YYYY for a discussion of how to specify a fixed window.
Related Information
End of IBM Extension
