Library View Topics Framed Contents Revised Topics Previous Topic Next Topic Search Search ResultsPrevious Topic MatchNext Topic Match Notes List Notes Print Download No PDF Handheld DisconnectedHandheld ConnectedHelp

7.1.1 Specifying a Function



The general format of a function-identifier is:


    ___ Format _____________________________________________________________ 
   |                                                                        |
   | >>__FUNCTION__function-name-1__ ______________________ ______________> |
   |                                |    <____________     |                |
   |                                |_(____argument-1_|__)_|                |
   |                                                                        |
   | >__ ____________________ ___________________________________________>< |
   |    |_reference-modifier_|                                              |
   |                                                                        |
   |________________________________________________________________________|
function-name-1
Function-name-1 must be one of the Intrinsic Function names.

argument-1
Argument-1 must be an identifier, literal (other than a figurative
X constant), or arithmetic expression. Argument-1 cannot be a windowed
X date field, except in the UNDATE intrinsic function.

reference-modifier
Can be specified only for functions of the category alphanumeric

Below, we will show examples of an intrinsic function invocation for an alphanumeric source statement and a numeric source statement.

The alphanumeric source statement:


     MOVE FUNCTION UPPER-CASE("hello") TO DATA-NAME.

replaces each lowercase letter in the argument with the corresponding uppercase letter, resulting in the movement of HELLO into DATA-NAME.

The numeric source statement,


     COMPUTE NUM-ITEM = FUNCTION SUM(A B C)

Adds the values of A, B, and C and places the result in NUM-ITEM.

Within a Procedure Division statement, each function-identifier is evaluated at the same time as any reference modification or subscripting associated with an identifier in that same position would be evaluated.

Subtopics:



Previous Topic Next Topic Copyright IBM Corp. 1991, 1998

IBM Library Server Copyright 1989, 2005 IBM Corporation. All rights reserved.





Return to library:   z/OS | z/OS.e | TPF | z/VSE | z/VM | IBM Hardware | IBM System z Redbooks
Glossary:   IBM terminology
Publications:   How to order publications
Readers:   Download IBM Library Reader | Download IBM Softcopy Reader | Download Adobe® Acrobat® Reader®
Library management:   Download IBM Softcopy Librarian
Contacts:   Contact z/OS


Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.