COBOL Manual for TNS and TNS/R Programs

Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs522555-006
14-21
INTEGER-OF-DATE Function
INTEGER-OF-DATE Function
INTEGER-OF-DATE, an integer function, converts a date in the Gregorian calendar
from standard date form (YYYYMMDD ) to integer date form.
argument
is an integer of the form YYYYMMDD, whose value is calculated from the equation
(YYYY * 10,000) + (MM * 100) + DD where:
The returned value is an integer that is the number of days that the date represented
by argument succeeds December 31, 1600, in the Gregorian calendar.
Example 14-14 uses the INTEGER-OF-DATE and REM functions to find the day of the
week for dates in standard date form (YYYYMMDD). For a description of the REM
function, see REM Function.
Factor Date Part Represented Represented by
YYYY Year in Gregorian calendar Integer in the range 1,601 through 9,999
MM Month of the year Integer in the range 1 through 12
DD Day of the month Integer in the range 1 through 31 that is a valid
day for the month specified by MM
Example 14-13. INTEGER-OF-DATE Function
Code:
DISPLAY FUNCTION INTEGER-OF-DATE (16010101)
DISPLAY FUNCTION INTEGER-OF-DATE (16011231)
DISPLAY FUNCTION INTEGER-OF-DATE (17001207)
DISPLAY FUNCTION INTEGER-OF-DATE (16341019)
DISPLAY FUNCTION INTEGER-OF-DATE (18741016)
Output:
00000001
00000365
00036500
00012345
00100000
( )
INTEGER-OF-DATEFUNCTION argument
VST432.vsd