IBM SC34-5764-01 Server User Manual


 
CALL
Purpose
 CALL
,
name
expression
OFF ERROR
FAILURE
HALT
ON ERROR
FAILURE NAME trapname
HALT
; 
CALL calls a routine (if you specify name) or controls the trapping of certain conditions (if you specify ON
or OFF).
To control trapping, you specify OFF or ON and the condition you want to trap. OFF turns off the specified
condition trap. ON turns on the specified condition trap. All information on condition traps is contained in
Chapter 17, “Conditions and Condition Traps,” on page 225.
To call a routine, a literal string or symbol that is taken as a constant, specify name. The name must be a
symbol, which is treated literally, or a literal string. The routine called can be:
An internal routine
A function or subroutine that is in the same program as the CALL instruction or function call that
calls it.
A built-in routine
A function (which may be called as a subroutine) that is defined as part of the REXX language.
An external routine
A function or subroutine that is neither built-in nor in the same program as the CALL instruction or
function call that calls it.
If name is a string (that is, you specify name in quotation marks), the search for internal routines is
bypassed, and only a built-in function or an external routine is called. Note that the names of built-in
functions (and generally the names of external routines, too) are in uppercase; therefore the name in the
literal string should also be in uppercase.
The called routine can optionally return a result, and when it does, the CALL instruction is functionally
identical with the clause:
 result=name(
,
expression
) ; 
If the called routine does not return a result, you get an error if you call it as a function (as previously
shown).
VM supports specifying up to 20 expressions, separated by commas. The expressions are evaluated in
order from left to right and form the argument strings during execution of the routine. Any ARG or PARSE
ARG instruction or ARG built-in function in the called routine accesses these strings rather than any
previously active in the calling program, until control returns to the CALL instruction. You can omit
expressions, if appropriate, by including extra commas.
CALL
Chapter 13. Keyword Instructions 135