EasyManuals Logo

IBM TSO/E REXX User Manual

IBM TSO/E REXX
242 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #89 background imageLoading...
Page #89 background image
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

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the IBM TSO/E REXX and is the answer not in the manual?

IBM TSO/E REXX Specifications

General IconGeneral
BrandIBM
ModelTSO/E REXX
CategoryComputer Hardware
LanguageEnglish

Related product manuals