COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 190 INTEGER Function
Code:
DISPLAY FUNCTION INTEGER (-3.5)
DISPLAY FUNCTION INTEGER (-3)
DISPLAY FUNCTION INTEGER (3)
DISPLAY FUNCTION INTEGER (3.5)
Output:
-4
-3
3
3
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:
Represented byDate Part RepresentedFactor
Integer in the range 1,601 through 9,999Year in Gregorian calendarYYYY
Integer in the range 1 through 12Month of the yearMM
Integer in the range 1 through 31 that is a valid day
for the month specified by MM
Day of the monthDD
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 191 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
Example 192 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.
INTEGER-OF-DATE Function 667










