Intrinsic functions - Enterprise COBOL for z/OS 6.3.0
See examples of using different types of intrinsic functions.
The following statement illustrates the use of intrinsic function UPPER-CASE to replace each lowercase letter in an alphanumeric argument with the corresponding
uppercase letter.
MOVE FUNCTION UPPER-CASE('hello') TO DATA-NAME.
This statement moves HELLO into DATA-NAME.
The following statement illustrates the use of intrinsic function LOWER-CASE to replace each uppercase letter in a national argument with the corresponding
lowercase letter.
MOVE FUNCTION LOWER-CASE(N'HELLO') TO N-DATA-NAME.
This statement moves national characters hello into N-DATA-NAME.
The following statement illustrates the use of a numeric intrinsic function:
COMPUTE NUM-ITEM = FUNCTION SUM(A B C)
This statement uses the numeric function SUM to add the values of A, B, and C and places the result in NUM-ITEM.
Published: 2020-12-14
© Copyright IBM Corp.