7.1.1.4 Arguments
The values returned by some functions are determined by the arguments
specified in the function-identifier when the functions are evaluated.
Some functions require no arguments; others require a fixed number of
arguments, and still others allow a variable number of arguments.
An argument must be one of the following:
- An identifier
- An arithmetic expression
- A function-identifier
- A literal other than a figurative constant.
- A special-register
The argument to a function can be any function or an expression containing
a function, including another evaluation of the same function, whose
result meets the category requirement for the argument.
X An argument cannot be a DBCS literal or data item. See "Function
X Definitions" in topic 7.1.2 for function specific argument specifications.
The types of arguments are:
- Alphabetic. An elementary data item of the class alphabetic or a
nonnumeric literal containing only alphabetic characters. The content
of the argument will be used to determine the value of the function.
The length of the argument can be used to determine the value of the
function.
- Alphanumeric. A data item of the class alphabetic or alphanumeric or a
nonnumeric literal. The content of the argument will be used to
determine the value of the function. The length of the argument can
be used to determine the value of the function.
- Integer. An arithmetic expression that will always result in an
integer value. The value of this expression, including its sign, is
used to determine the value of the function.
- Numeric. An arithmetic expression, whose value, including its sign, is
used to determine the value of the function.
Some functions place constraints on their arguments, such as the range of
values acceptable. If the values assigned as arguments for a function do
not comply with specified constraints, the returned value is undefined.
If a nested function is used as an argument, the evaluation of its
arguments will not be affected by the arguments in the outer function.
Only those arguments at the same function level interact with each other.
This interaction occurs in two areas:
- The computation of an arithmetic expression that appears as a function
argument will be affected by other arguments for that function.
- The evaluation of the function takes into consideration the attributes
of all of its arguments.
When a function is evaluated, its arguments are evaluated individually in
the order specified in the list of arguments, from left to right. The
argument being evaluated can be a function-identifier, or it can be an
expression containing function-identifiers.
If an arithmetic expression is specified as an argument, and if the first
operator in the expression is a unary plus or a unary minus, it must be
immediately preceded by a left parenthesis.
X Floating-point literals are allowed wherever a numeric argument is
X allowed, and in arithmetic expressions used in functions that allow a
X numeric argument. They are not allowed where an integer argument is
X required.
X External floating-point items are allowed wherever a numeric argument is
X allowed, and in arithmetic expressions used in functions that allow a
X numeric argument.
X External floating-point items are not allowed where an integer argument is
X required, or where an argument of alphanumeric class is allowed in a
X function identification, such as in the LOWER-CASE, REVERSE, UPPER-CASE,
X NUMVAL, and NUMVAL-C functions.
© 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.