COBOL Manual for TNS and TNS/R Programs
Intrinsic Functions
HP COBOL Manual for TNS and TNS/R Programs—522555-006
14-23
INTEGER-OF-DAY Function
INTEGER-OF-DAY Function
INTEGER-OF-DAY, an integer function, converts a date in the Gregorian calendar from
Julian date form (YYYYDDD ) to integer date form.
argument
is an integer of the form YYYYDDD, whose value is calculated from the equation
(YYYY * 1000) + 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.
Factor Date Part Represented Represented by
YYYY Year in Gregorian calendar Integer in the range 1,601 through 9,999
DD Day of the year Integer in the range 1 through 366 that is a
valid day for the year specified by YYYY
Example 14-15. INTEGER-OF-DAY Function
Code:
DISPLAY FUNCTION INTEGER-OF-DAY (1601001)
DISPLAY FUNCTION INTEGER-OF-DAY (1601365)
DISPLAY FUNCTION INTEGER-OF-DAY (1700341)
DISPLAY FUNCTION INTEGER-OF-DAY (1634292)
DISPLAY FUNCTION INTEGER-OF-DAY (1874289)
Output:
00000001
00000365
00036500
00012345
00100000
( )
INTEGER-OF-DAYFUNCTION argument
VST433.vsd