COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Example 219 TAN Function
Code:
DATA DIVISION.
WORKING-STORAGE SECTION.
01 A PICTURE S9V99.
PROCEDURE DIVISION.
MOVE FUNCTION ATAN (-10) TO A.
DISPLAY A.
MOVE FUNCTION ATAN (0) TO A.
DISPLAY A.
MOVE FUNCTION ATAN (.25) TO A.
DISPLAY A.
MOVE FUNCTION ATAN (15.5) TO A.
DISPLAY A.
MOVE FUNCTION ATAN (45) TO A.
DISPLAY A.
Output:
-0.64
0.00
0.25
-0.21
1.61
TEST-NUMVAL Function
TEST-NUMVAL, an integer function, returns a value indicating whether the specified character-string
is valid input to the NUMVAL Function (page 679).
string
is a nonnumeric literal or an alphanumeric data item.
The returned value is zero if string conforms to the format described for the argument of the
NUMVAL Function (page 679), or gives the character position of the first invalid character. If string
is valid but incomplete (for example, it contains no digits), the returned value is the length of the
string plus one (indicating the character position immediately following string).
TEST-NUMVAL Function 693