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

Example 221 TEST-NUMVAL-C Function
Code:
IDENTIFICATION DIVISION.
PROGRAM-ID. TEST-NUMVAL-C.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 WS-DATA.
03 A PIC S9(4).
PROCEDURE DIVISION.
MAIN-LOGIC SECTION.
MOVE FUNCTION TEST-NUMVAL-c("35") to A.
DISPLAY A.
MOVE FUNCTION TEST-NUMVAL-c("$35") to A.
DISPLAY A.
MOVE FUNCTION TEST-NUMVAL-c("35$") to A.
DISPLAY A.
MOVE FUNCTION TEST-NUMVAL-c("35.75") to A.
DISPLAY A.
MOVE FUNCTION TEST-NUMVAL-c(".35") to A.
DISPLAY A.
MOVE FUNCTION TEST-NUMVAL-c("=35.75") to A.
DISPLAY A.
MOVE FUNCTION TEST-NUMVAL-c("35.75 CR") to A.
DISPLAY A.
STOP RUN.
Output:
0000
0000
0000
0000
0000
0001
0000
UPPER-CASE Function
UPPER-CASE, an alphanumeric function, returns a character-string that is the same as its argument,
except that each lowercase letter is replaced by the corresponding uppercase letter.
string
is an alphabetic or alphanumeric string at least one character in length.
The returned value is the same as the value of string, except that each lowercase letter is replaced
by the corresponding uppercase letter. If the value of string contains no lowercase letters, or if
the ALPHABET clause specifies a collating sequence that contains no uppercase letters, the returned
value is the same as the value of string.
UPPER-CASE Function 695