Previous topic |
Next topic |
Contents |
Contact z/OS |
Library |
PDF
Calling a subprocedure z/OS TSO/E CLISTs SA32-0978-00 |
|
You call a subprocedure using the SYSCALL statement. On the SYSCALL statement, name the subprocedure and any parameters you want to pass to the subprocedure. The parameters can be data strings, variable values, or variable names. For example, the following CLIST uses the SYSCALL statement to
pass a data string (Jones), a variable value (&A), and a variable
name (B) to a subprocedure (XYZ):
Subprocedures always begin with a labeled PROC statement.
The label can consist of 1-31 characters (A-Z, 0-9, #, $, @) beginning
with an alphabetic character (A-Z). In the example above, the label
is XYZ; the number 3 on
the PROC statement indicates that the subprocedure receives 3 positional
parameters; those parameters are assigned to the variables PARM1,
PARM2, and PARM3. For more information about the PROC statement,
see PROC statement.The SYSREF statement tells the CLIST that PARM3 contains the name of a variable (B). The SYSREF statement allows other statements in subprocedure to reference and modify the variable's value (Jr.). For more information, see Using the SYSREF statement. To pass a parameter containing blanks to a subprocedure, set a
variable equal to the parameter value, then refer to that variable
(without the ampersand) using &STR on the SYSCALL statement.
In the subprocedure, use the SYSREF statement to refer to the PROC
statement parameter that corresponds to the variable name passed on
the SYSCALL statement. For example,
Subprocedures must always end with the END statement. When subprocedures end, they pass control back to the statement following the SYSCALL statement. Subprocedures can use the SYSCALL statement to:
|
Copyright IBM Corporation 1990, 2014
|