Use the CALL statement to invoke scripts from within scripts.
Optionally, parameters can be passed between the called script and the calling script. The number of return values must match the number of OUTPUT variables defined in the called script, and the number of parameters passed to the called script must match the number of INPUT variables defined in the called script.
If the script name specified in the CALL is not found, the EX_NO_SCRIPT exception definition script is invoked. By default, the script is abnormally terminated. To handle a failed CALL statement in a different way, you need to write an exception handler for this condition, as described in EXCEPTION.
CALL this_script; CALL dir_search ( names, Wombat ); a, b, c = CALL read_rec_script ( x, y, z );
To use the 3270 Script window’s Statements menu to define a CALL statement, follow this procedure:
The system displays the Call Script Definition window.
In the Value field that appears in the window, type the variable name of the input parameter, or click Value to display the Term Definition window to select the parameter.
Repeat this as required.
In the Result field that appears in the window, type the variable name of the output parameter, or click Result to select the parameter.
Repeat this step as required.
The CALL statement is added to the script.