Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Writing a Function z/OS TSO/E REXX User's Guide SA32-0982-00 |
|
A function
is a series of instructions that an exec invokes to perform a specific
task and return a value. As was described in Using Functions,
a function may be built-in or user-written. An exec invokes a user-written
function the same way it invokes a built-in function — by the function
name immediately followed by parentheses with no blanks in between.
The parentheses can contain up to 20 arguments or no arguments at
all.
or
A function requires a returned value because the function call
generally appears in an expression.
When the function ends, it may use the RETURN instruction to send back a value to replace the function call. Functions may be internal and designated by a label, or external and designated by the data set member name that contains the function. The previous example illustrates an internal function named "func1". IMPORTANT NOTE Because internal functions generally appear after the main part of the exec, when you have an internal function, it is important to end the main part of the exec with the EXIT instruction. The following illustrates an external function named "func2". To determine whether to make a function internal
or external, you might consider factors, such as:
|
Copyright IBM Corporation 1990, 2014
|