COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 213 REM Function
Code:
DISPLAY FUNCTION REM (11 5)
DISPLAY FUNCTION REM (-11 5)
DISPLAY FUNCTION REM (11 -5)
DISPLAY FUNCTION REM (-11 -5)
Output:
01
-01
01
-01
REVERSE Function
REVERSE, an alphanumeric function, returns a string that is the same as its argument, except that
the characters are in reverse order.
argument
is an alphabetic or alphanumeric argument at least one character in length.
The returned value is the same as argument, except that the characters are in reverse order. That
is, if argument has n characters, then the i th character of argument is the (n - i +1)th character
of the returned value.
Example 214 REVERSE Function
Code:
DISPLAY FUNCTION REVERSE ("A")
DISPLAY FUNCTION REVERSE ("1234567")
DISPLAY FUNCTION REVERSE ("stressed")
DISPLAY FUNCTION REVERSE ("ABC 123")
Output:
A
7654321
desserts
321 CBA
SIN Function
SIN, a numeric function, returns a value that approximates the sine of the angle or arc (in radians)
specified by its argument.
argument
is a numeric argument.
The returned value approximates the sine of the value of argument. It is a floating-point number
in the range -1 to +1. It has no implied decimal point and is precise to approximately 14 digits.
688 Intrinsic Functions










