followed by parentheses with no blanks in between. The parentheses can contain
up to 20 arguments or no arguments at all.
function(argument1, argument2,...)
or
function()
A function requires a returned value because the function call generally appears in
an expression.
x = function(arguments1, argument2,...)
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".
instruction(s)
x=func1(arg1,arg2)
instruction(s)
EXIT
Func1:
instruction(s)
RETURN value
Writing a Function
78
z/OS V1R1.0 TSO/E REXX User’s Guide