Subroutines may be
internal
and designated by a label, or
external
and designated
by the data set member name that contains the subroutine. The preceding example
illustrates an internal subroutine named "sub1".
IMPORTANT NOTE
Because internal subroutines generally appear after the main part of the exec,
when you have an internal subroutine, it is important to end the main part of
the exec with the EXIT instruction.
The following illustrates an external subroutine named "sub2".
To determine whether to make a subroutine internal or external, you might consider
factors, such as:
v
Size of the subroutine. Very large subroutines often are external, whereas small
subroutines fit easily within the calling exec.
v
How you want to pass information. It is quicker to pass information through
variables in an internal subroutine. This method is described in “Passing
Information by Using Variables” on page 72.
v
Whether the subroutine might be of value to more than one exec or user. If so,
an external subroutine is preferable.
instruction(s)
CALL sub1
instruction(s)
EXIT
sub1:
instruction(s)
RETURN
REXX.EXEC(MAIN)
instruction(s)
CALL sub2
instruction(s)
.
.
.
REXX.EXEC(SUB2)
instruction(s)
RETURN
Writing a Subroutine;
Chapter 6. Writing Subroutines and Functions
71
Содержание TSO/E REXX
Страница 1: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 2: ......
Страница 3: ...z OS TSO E REXX User s Guide SA22 7791 00 ...
Страница 10: ...viii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 12: ...x z OS V1R1 0 TSO E REXX User s Guide ...
Страница 14: ...xii z OS V1R1 0 TSO E REXX User s Guide ...
Страница 18: ...xvi z OS V1R1 0 TSO E REXX User s Guide ...
Страница 20: ...2 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 58: ...Tracing Expressions with the TRACE Instruction 40 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 78: ...60 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 86: ...Built In Functions 68 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 128: ...Issuing Other Types of Commands from an Exec 110 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 136: ...Debugging Execs 118 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 170: ...Protecting Elements in the Data Stack 152 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 201: ...Part 3 Appendixes Copyright IBM Corp 1988 2001 183 ...
Страница 202: ...184 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 222: ...Using Variables 204 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 226: ...208 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 238: ...220 z OS V1R1 0 TSO E REXX User s Guide ...
Страница 241: ......