COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 185 COS Function
Code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PICTURE S9V99.
PROCEDURE DIVISION.
MOVE FUNCTION COS (-10) TO A.
DISPLAY A.
MOVE FUNCTION COS (0) TO A.
DISPLAY A.
MOVE FUNCTION COS (.25) TO A.
DISPLAY A.
MOVE FUNCTION COS (15.5) TO A.
DISPLAY A.
MOVE FUNCTION COS (45) TO A.
DISPLAY A.
Output:
-0.83
1.00
0.96
-0.97
0.52
CURRENT-DATE Function
CURRENT-DATE, an alphanumeric function, returns a 21-character string that represents the calendar
date, time of day, and local time differential factor provided by the operating environment.
The returned value represents the current date this way (where character position 1 is the leftmost
character position):
Represented byDate Part RepresentedCharacter Positions
Four digitsYear in Gregorian calendar1-4
Two digits in the range 01 through 12Month of the year5-6
Two digits in the range 01 through 31Day of the month7-8
Two digits in the range 00 through 23Hours past midnight9-10
Two digits in the range 00 through 59Minutes past the hour11-12
Two digits in the range 00 through 59Seconds past the minute13-14
Two digits in the range 00 through 99Hundredths of seconds past the
second
15-16
Minus (-) if the reported time is behind Greenwich mean
time, plus (+) if it is the same as or ahead of Greenwich
mean time
Relationship to Greenwich mean time17
If character position 17 is minus (-), two digits in the
range 00 through 12; if character position 17 is plus
(+), two digits in the range 00 through 13
Hours behind or ahead of Greenwich
mean time
18-19
Two digits in the range 00 through 59Additional minutes from Greenwich
mean time
20-21
664 Intrinsic Functions










